git-whatchanged.1   [plain text]


'\" t
.\"     Title: git-whatchanged
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
.\"      Date: 06/01/2011
.\"    Manual: Git Manual
.\"    Source: Git 1.7.5.4
.\"  Language: English
.\"
.TH "GIT\-WHATCHANGED" "1" "06/01/2011" "Git 1\&.7\&.5\&.4" "Git Manual"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
git-whatchanged \- Show logs with difference each commit introduces
.SH "SYNOPSIS"
.sp
\fIgit whatchanged\fR <option>\&...
.SH "DESCRIPTION"
.sp
Shows commit logs and diff output each commit introduces\&. The command internally invokes \fIgit rev\-list\fR piped to \fIgit diff\-tree\fR, and takes command line options for both of these commands\&.
.sp
This manual page describes only the most frequently used options\&.
.SH "OPTIONS"
.PP
\-p
.RS 4
Show textual diffs, instead of the git internal diff output format that is useful only to tell the changed paths and their nature of changes\&.
.RE
.PP
\-<n>
.RS 4
Limit output to <n> commits\&.
.RE
.PP
<since>\&.\&.<until>
.RS 4
Limit output to between the two named commits (bottom exclusive, top inclusive)\&.
.RE
.PP
\-r
.RS 4
Show git internal diff output, but for the whole tree, not just the top level\&.
.RE
.PP
\-m
.RS 4
By default, differences for merge commits are not shown\&. With this flag, show differences to that commit from all of its parents\&.
.sp
However, it is not very useful in general, although it
\fBis\fR
useful on a file\-by\-file basis\&.
.RE
.PP
\-\-pretty[=<format>], \-\-format=<format>
.RS 4
Pretty\-print the contents of the commit logs in a given format, where
\fI<format>\fR
can be one of
\fIoneline\fR,
\fIshort\fR,
\fImedium\fR,
\fIfull\fR,
\fIfuller\fR,
\fIemail\fR,
\fIraw\fR
and
\fIformat:<string>\fR\&. See the "PRETTY FORMATS" section for some additional details for each format\&. When omitted, the format defaults to
\fImedium\fR\&.
.sp
Note: you can specify the default pretty format in the repository configuration (see
\fBgit-config\fR(1))\&.
.RE
.PP
\-\-abbrev\-commit
.RS 4
Instead of showing the full 40\-byte hexadecimal commit object name, show only a partial prefix\&. Non default number of digits can be specified with "\-\-abbrev=<n>" (which also modifies diff output, if it is displayed)\&.
.sp
This should make "\-\-pretty=oneline" a whole lot more readable for people using 80\-column terminals\&.
.RE
.PP
\-\-oneline
.RS 4
This is a shorthand for "\-\-pretty=oneline \-\-abbrev\-commit" used together\&.
.RE
.PP
\-\-encoding[=<encoding>]
.RS 4
The commit objects record the encoding used for the log message in their encoding header; this option can be used to tell the command to re\-code the commit log message in the encoding preferred by the user\&. For non plumbing commands this defaults to UTF\-8\&.
.RE
.PP
\-\-no\-notes, \-\-show\-notes[=<ref>]
.RS 4
Show the notes (see
\fBgit-notes\fR(1)) that annotate the commit, when showing the commit log message\&. This is the default for
git log,
git show
and
git whatchanged
commands when there is no
\-\-pretty,
\-\-format
nor
\-\-oneline
option is given on the command line\&.
.sp
With an optional argument, add this ref to the list of notes\&. The ref is taken to be in
refs/notes/
if it is not qualified\&.
.RE
.PP
\-\-[no\-]standard\-notes
.RS 4
Enable or disable populating the notes ref list from the
\fIcore\&.notesRef\fR
and
\fInotes\&.displayRef\fR
variables (or corresponding environment overrides)\&. Enabled by default\&. See
\fBgit-config\fR(1)\&.
.RE
.SH "PRETTY FORMATS"
.sp
If the commit is a merge, and if the pretty\-format is not \fIoneline\fR, \fIemail\fR or \fIraw\fR, an additional line is inserted before the \fIAuthor:\fR line\&. This line begins with "Merge: " and the sha1s of ancestral commits are printed, separated by spaces\&. Note that the listed commits may not necessarily be the list of the \fBdirect\fR parent commits if you have limited your view of history: for example, if you are only interested in changes related to a certain directory or file\&.
.sp
There are several built\-in formats, and you can define additional formats by setting a pretty\&.<name> config option to either another format name, or a \fIformat:\fR string, as described below (see \fBgit-config\fR(1))\&. Here are the details of the built\-in formats:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIoneline\fR
.sp
.if n \{\
.RS 4
.\}
.nf
<sha1> <title line>
.fi
.if n \{\
.RE
.\}
.sp
This is designed to be as compact as possible\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIshort\fR
.sp
.if n \{\
.RS 4
.\}
.nf
commit <sha1>
Author: <author>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<title line>
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fImedium\fR
.sp
.if n \{\
.RS 4
.\}
.nf
commit <sha1>
Author: <author>
Date:   <author date>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<title line>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<full commit message>
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIfull\fR
.sp
.if n \{\
.RS 4
.\}
.nf
commit <sha1>
Author: <author>
Commit: <committer>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<title line>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<full commit message>
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIfuller\fR
.sp
.if n \{\
.RS 4
.\}
.nf
commit <sha1>
Author:     <author>
AuthorDate: <author date>
Commit:     <committer>
CommitDate: <committer date>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<title line>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<full commit message>
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIemail\fR
.sp
.if n \{\
.RS 4
.\}
.nf
From <sha1> <date>
From: <author>
Date: <author date>
Subject: [PATCH] <title line>
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
<full commit message>
.fi
.if n \{\
.RE
.\}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIraw\fR
.sp
The
\fIraw\fR
format shows the entire commit exactly as stored in the commit object\&. Notably, the SHA1s are displayed in full, regardless of whether \-\-abbrev or \-\-no\-abbrev are used, and
\fIparents\fR
information show the true parent commits, without taking grafts nor history simplification into account\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fIformat:<string>\fR
.sp
The
\fIformat:<string>\fR
format allows you to specify which information you want to show\&. It works a little bit like printf format, with the notable exception that you get a newline with
\fI%n\fR
instead of
\fI\en\fR\&.
.sp
E\&.g,
\fIformat:"The author of %h was %an, %ar%nThe title was >>%s<<%n"\fR
would show something like this:
.sp
.if n \{\
.RS 4
.\}
.nf
The author of fe6e0ee was Junio C Hamano, 23 hours ago
The title was >>t4119: test autocomputing \-p<n> for traditional diff input\&.<<
.fi
.if n \{\
.RE
.\}
.sp
The placeholders are:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%H\fR: commit hash
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%h\fR: abbreviated commit hash
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%T\fR: tree hash
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%t\fR: abbreviated tree hash
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%P\fR: parent hashes
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%p\fR: abbreviated parent hashes
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%an\fR: author name
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%aN\fR: author name (respecting \&.mailmap, see
\fBgit-shortlog\fR(1)
or
\fBgit-blame\fR(1))
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ae\fR: author email
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%aE\fR: author email (respecting \&.mailmap, see
\fBgit-shortlog\fR(1)
or
\fBgit-blame\fR(1))
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ad\fR: author date (format respects \-\-date= option)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%aD\fR: author date, RFC2822 style
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ar\fR: author date, relative
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%at\fR: author date, UNIX timestamp
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ai\fR: author date, ISO 8601 format
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%cn\fR: committer name
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%cN\fR: committer name (respecting \&.mailmap, see
\fBgit-shortlog\fR(1)
or
\fBgit-blame\fR(1))
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ce\fR: committer email
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%cE\fR: committer email (respecting \&.mailmap, see
\fBgit-shortlog\fR(1)
or
\fBgit-blame\fR(1))
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%cd\fR: committer date
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%cD\fR: committer date, RFC2822 style
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%cr\fR: committer date, relative
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ct\fR: committer date, UNIX timestamp
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%ci\fR: committer date, ISO 8601 format
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%d\fR: ref names, like the \-\-decorate option of
\fBgit-log\fR(1)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%e\fR: encoding
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%s\fR: subject
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%f\fR: sanitized subject line, suitable for a filename
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%b\fR: body
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%B\fR: raw body (unwrapped subject and body)
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%N\fR: commit notes
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%gD\fR: reflog selector, e\&.g\&.,
refs/stash@{1}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%gd\fR: shortened reflog selector, e\&.g\&.,
stash@{1}
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%gs\fR: reflog subject
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%Cred\fR: switch color to red
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%Cgreen\fR: switch color to green
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%Cblue\fR: switch color to blue
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%Creset\fR: reset color
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%C(\&...)\fR: color specification, as described in color\&.branch\&.* config option
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%m\fR: left, right or boundary mark
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%n\fR: newline
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%%\fR: a raw
\fI%\fR
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%x00\fR: print a byte from a hex code
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fI%w([<w>[,<i1>[,<i2>]]])\fR: switch line wrapping, like the \-w option of
\fBgit-shortlog\fR(1)\&.
.RE
.RE
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
Some placeholders may depend on other options given to the revision traversal engine\&. For example, the %g* reflog options will insert an empty string unless we are traversing reflog entries (e\&.g\&., by git log \-g)\&. The %d placeholder will use the "short" decoration format if \-\-decorate was not already provided on the command line\&.
.sp .5v
.RE
.sp
If you add a + (plus sign) after \fI%\fR of a placeholder, a line\-feed is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
.sp
If you add a \- (minus sign) after \fI%\fR of a placeholder, line\-feeds that immediately precede the expansion are deleted if and only if the placeholder expands to an empty string\&.
.sp
If you add a ` ` (space) after \fI%\fR of a placeholder, a space is inserted immediately before the expansion if and only if the placeholder expands to a non\-empty string\&.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}

\fItformat:\fR
.sp
The
\fItformat:\fR
format works exactly like
\fIformat:\fR, except that it provides "terminator" semantics instead of "separator" semantics\&. In other words, each commit has the message terminator character (usually a newline) appended, rather than a separator placed between entries\&. This means that the final entry of a single\-line format will be properly terminated with a new line, just as the "oneline" format does\&. For example:
.sp
.if n \{\
.RS 4
.\}
.nf
$ git log \-2 \-\-pretty=format:%h 4da45bef \e
  | perl \-pe \(aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\(aq
4da45be
7134973 \-\- NO NEWLINE

$ git log \-2 \-\-pretty=tformat:%h 4da45bef \e
  | perl \-pe \(aq$_ \&.= " \-\- NO NEWLINE\en" unless /\en/\(aq
4da45be
7134973
.fi
.if n \{\
.RE
.\}
.sp
In addition, any unrecognized string that has a
%
in it is interpreted as if it has
tformat:
in front of it\&. For example, these two are equivalent:
.sp
.if n \{\
.RS 4
.\}
.nf
$ git log \-2 \-\-pretty=tformat:%h 4da45bef
$ git log \-2 \-\-pretty=%h 4da45bef
.fi
.if n \{\
.RE
.\}
.sp
.RE
.SH "EXAMPLES"
.PP
git whatchanged \-p v2\&.6\&.12\&.\&. include/scsi drivers/scsi
.RS 4
Show as patches the commits since version
\fIv2\&.6\&.12\fR
that changed any file in the include/scsi or drivers/scsi subdirectories
.RE
.PP
git whatchanged \-\-since="2 weeks ago" \-\- gitk
.RS 4
Show the changes during the last two weeks to the file
\fIgitk\fR\&. The "\-\-" is necessary to avoid confusion with the
\fBbranch\fR
named
\fIgitk\fR
.RE
.SH "GIT"
.sp
Part of the \fBgit\fR(1) suite