<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_help_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Help Topic: The Git log Command}
\vspace{0.1in}
\labdate{Spring 2022}
\vspace{0.1in}
\labauth{Oscar Viquez, oviquezr@mit.edu}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labline
\end{labcover}

\wikidoc{file=Help.GitLog}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{The Git \cmd{log} Command}
%====================================================================

The \cmd{git log} command provides useful information about a given
repository's commit history. It must be executed on the command line
somewhere within the directory of the locally checked out repository.
More info can always be found by Googling "Git book" and reading
the full PDF online free, or just typing \cmd{git help log}
anytime on the command line.

%---------------------------------------------------------------------
\subsection*{The \cmd{git log} command}

The \cmd{git log} command provides a log of changes made to the repository
across the group of developers. It is incremental in date, and tells you who
made the change and when. It should also tell you, in a short description,
what changes or fixes were involved for a given log entry. The basic format
is this:

\vspace{0.05in}
\begin{consoleverb}
 $ git log          #(invoked somewhere within previously checked out tree)
\end{consoleverb}
\vspace{0.15in}

\noindent
If there's more than a handful of log entries in the history, the log
will open within the \cmd{less} pager program to make it easier to
scroll through the commit history; you can quit by pressing \var{'q'}
to leave the pager utility.  Since the most common entry of interest
is the most recent entry, log entries are reported in descending order
by commit date and time. You can also choose to display only a limited
number of entries:

\vspace{0.05in}
\begin{consoleverb}
 $ git log -n 3     #(Shows only the 3 most recent entries)
\end{consoleverb}
\vspace{0.15in}

\noindent
Here is an example from my locally checked out copy of the moos-ivp tree.

\vspace{0.05in}
\begin{consoleverb}
$ cd moos-ivp/
$ git log -n 5
 commit e3f29da14962544b91d04d105ec31fdb952c0a7c (HEAD -&gt; master, origin/master,
 origin/HEAD)
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Mon Jan 24 14:03:07 2022 +0000

     more minor mods to support wind/arrows

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9948
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf

 commit fc39961f9fa0f2ef3384d719ae8852f21d0fd2d6
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Mon Jan 24 01:53:40 2022 +0000

     more mods to accommodate XYArrow class in viewer related code

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9947
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf

 commit b8f71284e2c1d74c80d39808d6f55411cba4fbca
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Sun Jan 23 23:45:30 2022 +0000

     added XYArrow class to the geometry library

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9946
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf

 commit 5bda70c08ac61db3a9d89f6bf82e76193fc17a0c
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Sun Jan 23 00:54:43 2022 +0000

     mod to MarineViewer in drawing circles

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9945
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf

 commit 800beee30f9aad4d9ee2a42b2a7677c4db762fca
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Sat Jan 22 01:36:31 2022 +0000

     mod to pMarineViewer to allow multiple viewers to launch using the
 pAntler aliasing feature

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9944
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf

\end{consoleverb}
\vspace{0.15in}

\noindent
The comments in the log entries are important, and are generated upon
a {\em commit} to the tree. In the case of the git-based mirror of the
SVN tree, these comments include information about the corresponding
SVN revision.

\vspace{0.1in}
\noindent
You have to use your own judgement in striking a balance between quick
and convenient commits with minimal comments, and more verbose commits
which take more time. At some point you may need the comments of your
log to help you revert changes or just remind yourself when something
key changed in the history.

%---------------------------------------------------------------------
\subsection*{Knowing exactly what files changed for a given commit/log entry}

In the \cmd{git log} example above, the entry for SVN revision number 9948
(by the Git-SVN relational comment) looks like:

\vspace{0.05in}
\begin{consoleverb}
 commit e3f29da14962544b91d04d105ec31fdb952c0a7c (HEAD -&gt; master, origin/master,
 origin/HEAD)
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Mon Jan 24 14:03:07 2022 +0000

     more minor mods to support wind/arrows

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9948
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf
\end{consoleverb}
\vspace{0.15in}

\noindent 
This shows the comment entered by the person committing the change, but
{\em what really changed} in this commit? It would be good to at least
know what files are involved. This can be done using the \cmd{git show}
command, as follows:

\vspace{0.05in}
\begin{consoleverb}
 $ git show --name-only e3f29da14962544b91d04d105ec31fdb952c0a7c
 commit e3f29da14962544b91d04d105ec31fdb952c0a7c (HEAD -&gt; master, origin/master,
 origin/HEAD)
 Author: mikerb &lt;mikerb@7b6de600-d9ab-45c9-a1ca-e8145d3c6daf&gt;
 Date:   Mon Jan 24 14:03:07 2022 +0000

     more minor mods to support wind/arrows

     git-svn-id: https://oceanai.mit.edu/svn/moos-ivp-aro/trunk@9948
 7b6de600-d9ab-45c9-a1ca-e8145d3c6daf

 ivp/src/lib_geometry/VPlug_GeoShapes.cpp
 ivp/src/lib_geometry/XYArrow.cpp
 ivp/src/pMarineViewer/PMV_Viewer.cpp
\end{consoleverb}
\vspace{0.15in}

\noindent
To remove the commit summary headers and show only the modified files,
add the \cmd{--pretty=""} argument:

\vspace{0.05in}
\begin{consoleverb}
 $ git show --pretty="" --name-only e3f29da14962544b91d04d105ec31fdb952c0a7c
 ivp/src/lib_geometry/VPlug_GeoShapes.cpp
 ivp/src/lib_geometry/XYArrow.cpp
 ivp/src/pMarineViewer/PMV_Viewer.cpp
\end{consoleverb}
\vspace{0.15in}

\end{document}

</pre></body></html>