1 <?xml version="1.0" encoding="UTF-8"?>
\r
2 <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
\r
4 <article lang="en" id="git-whatchanged(1)">
\r
6 <title>git-whatchanged(1)</title>
\r
8 <primary>git-whatchanged(1)</primary>
\r
11 <simplesect id="_name">
\r
13 <simpara>git-whatchanged - Show logs with difference each commit introduces</simpara>
\r
15 <simplesect id="_synopsis">
\r
16 <title>SYNOPSIS</title>
\r
17 <simpara><emphasis>git whatchanged</emphasis> <option>…</simpara>
\r
19 <simplesect id="_description">
\r
20 <title>DESCRIPTION</title>
\r
21 <simpara>Shows commit logs and diff output each commit introduces. The
\r
22 command internally invokes <emphasis>git-rev-list</emphasis> piped to
\r
23 <emphasis>git-diff-tree</emphasis>, and takes command line options for both of
\r
24 these commands.</simpara>
\r
25 <simpara>This manual page describes only the most frequently used options.</simpara>
\r
27 <simplesect id="_options">
\r
28 <title>OPTIONS</title>
\r
36 Show textual diffs, instead of the git internal diff
\r
37 output format that is useful only to tell the changed
\r
38 paths and their nature of changes.
\r
48 Limit output to <n> commits.
\r
54 <since>..<until>
\r
58 Limit output to between the two named commits (bottom
\r
59 exclusive, top inclusive).
\r
69 Show git internal diff output, but for the whole tree,
\r
70 not just the top level.
\r
80 By default, differences for merge commits are not shown.
\r
81 With this flag, show differences to that commit from all
\r
84 <simpara>However, it is not very useful in general, although it
\r
85 <emphasis role="strong">is</emphasis> useful on a file-by-file basis.</simpara>
\r
90 --pretty[=<emphasis><format></emphasis>]
\r
94 Pretty-print the contents of the commit logs in a given format,
\r
95 where <emphasis><format></emphasis> can be one of <emphasis>oneline</emphasis>, <emphasis>short</emphasis>, <emphasis>medium</emphasis>,
\r
96 <emphasis>full</emphasis>, <emphasis>fuller</emphasis>, <emphasis>email</emphasis>, <emphasis>raw</emphasis> and <emphasis>format:<string></emphasis>.
\r
97 When omitted, the format defaults to <emphasis>medium</emphasis>.
\r
99 <simpara>Note: you can specify the default pretty format in the repository
\r
100 configuration (see <xref linkend="git-config(1)"/>).</simpara>
\r
109 Instead of showing the full 40-byte hexadecimal commit object
\r
110 name, show only a partial prefix. Non default number of
\r
111 digits can be specified with "--abbrev=<n>" (which also modifies
\r
112 diff output, if it is displayed).
\r
114 <simpara>This should make "--pretty=oneline" a whole lot more readable for
\r
115 people using 80-column terminals.</simpara>
\r
120 --encoding[=<encoding>]
\r
124 The commit objects record the encoding used for the log message
\r
125 in their encoding header; this option can be used to tell the
\r
126 command to re-code the commit log message in the encoding
\r
127 preferred by the user. For non plumbing commands this
\r
134 <simplesect id="_pretty_formats">
\r
135 <title>PRETTY FORMATS</title>
\r
136 <simpara>If the commit is a merge, and if the pretty-format
\r
137 is not <emphasis>oneline</emphasis>, <emphasis>email</emphasis> or <emphasis>raw</emphasis>, an additional line is
\r
138 inserted before the <emphasis>Author:</emphasis> line. This line begins with
\r
139 "Merge: " and the sha1s of ancestral commits are printed,
\r
140 separated by spaces. Note that the listed commits may not
\r
141 necessarily be the list of the <emphasis role="strong">direct</emphasis> parent commits if you
\r
142 have limited your view of history: for example, if you are
\r
143 only interested in changes related to a certain directory or
\r
145 <simpara>Here are some additional details for each format:</simpara>
\r
149 <emphasis>oneline</emphasis>
\r
151 <literallayout class="monospaced"><sha1> <title line></literallayout>
\r
152 <simpara>This is designed to be as compact as possible.</simpara>
\r
156 <emphasis>short</emphasis>
\r
158 <literallayout class="monospaced">commit <sha1>
\r
159 Author: <author></literallayout>
\r
160 <literallayout class="monospaced"><title line></literallayout>
\r
164 <emphasis>medium</emphasis>
\r
166 <literallayout class="monospaced">commit <sha1>
\r
167 Author: <author>
\r
168 Date: <author date></literallayout>
\r
169 <literallayout class="monospaced"><title line></literallayout>
\r
170 <literallayout class="monospaced"><full commit message></literallayout>
\r
174 <emphasis>full</emphasis>
\r
176 <literallayout class="monospaced">commit <sha1>
\r
177 Author: <author>
\r
178 Commit: <committer></literallayout>
\r
179 <literallayout class="monospaced"><title line></literallayout>
\r
180 <literallayout class="monospaced"><full commit message></literallayout>
\r
184 <emphasis>fuller</emphasis>
\r
186 <literallayout class="monospaced">commit <sha1>
\r
187 Author: <author>
\r
188 AuthorDate: <author date>
\r
189 Commit: <committer>
\r
190 CommitDate: <committer date></literallayout>
\r
191 <literallayout class="monospaced"><title line></literallayout>
\r
192 <literallayout class="monospaced"><full commit message></literallayout>
\r
196 <emphasis>email</emphasis>
\r
198 <literallayout class="monospaced">From <sha1> <date>
\r
199 From: <author>
\r
200 Date: <author date>
\r
201 Subject: [PATCH] <title line></literallayout>
\r
202 <literallayout class="monospaced"><full commit message></literallayout>
\r
206 <emphasis>raw</emphasis>
\r
208 <simpara>The <emphasis>raw</emphasis> format shows the entire commit exactly as
\r
209 stored in the commit object. Notably, the SHA1s are
\r
210 displayed in full, regardless of whether --abbrev or
\r
211 --no-abbrev are used, and <emphasis>parents</emphasis> information show the
\r
212 true parent commits, without taking grafts nor history
\r
213 simplification into account.</simpara>
\r
217 <emphasis>format:</emphasis>
\r
219 <simpara>The <emphasis>format:</emphasis> format allows you to specify which information
\r
220 you want to show. It works a little bit like printf format,
\r
221 with the notable exception that you get a newline with <emphasis>%n</emphasis>
\r
222 instead of <emphasis>\n</emphasis>.</simpara>
\r
223 <simpara>E.g, <emphasis>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</emphasis>
\r
224 would show something like this:</simpara>
\r
225 <literallayout>The author of fe6e0ee was Junio C Hamano, 23 hours ago
\r
226 The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</literallayout>
\r
227 <simpara>The placeholders are:</simpara>
\r
231 <emphasis>%H</emphasis>: commit hash
\r
236 <emphasis>%h</emphasis>: abbreviated commit hash
\r
241 <emphasis>%T</emphasis>: tree hash
\r
246 <emphasis>%t</emphasis>: abbreviated tree hash
\r
251 <emphasis>%P</emphasis>: parent hashes
\r
256 <emphasis>%p</emphasis>: abbreviated parent hashes
\r
261 <emphasis>%an</emphasis>: author name
\r
266 <emphasis>%aN</emphasis>: author name (respecting .mailmap)
\r
271 <emphasis>%ae</emphasis>: author email
\r
276 <emphasis>%aE</emphasis>: author email (respecting .mailmap)
\r
281 <emphasis>%ad</emphasis>: author date (format respects --date= option)
\r
286 <emphasis>%aD</emphasis>: author date, RFC2822 style
\r
291 <emphasis>%ar</emphasis>: author date, relative
\r
296 <emphasis>%at</emphasis>: author date, UNIX timestamp
\r
301 <emphasis>%ai</emphasis>: author date, ISO 8601 format
\r
306 <emphasis>%cn</emphasis>: committer name
\r
311 <emphasis>%cN</emphasis>: committer name (respecting .mailmap)
\r
316 <emphasis>%ce</emphasis>: committer email
\r
321 <emphasis>%cE</emphasis>: committer email (respecting .mailmap)
\r
326 <emphasis>%cd</emphasis>: committer date
\r
331 <emphasis>%cD</emphasis>: committer date, RFC2822 style
\r
336 <emphasis>%cr</emphasis>: committer date, relative
\r
341 <emphasis>%ct</emphasis>: committer date, UNIX timestamp
\r
346 <emphasis>%ci</emphasis>: committer date, ISO 8601 format
\r
351 <emphasis>%d</emphasis>: ref names, like the --decorate option of <xref linkend="git-log(1)"/>
\r
356 <emphasis>%e</emphasis>: encoding
\r
361 <emphasis>%s</emphasis>: subject
\r
366 <emphasis>%b</emphasis>: body
\r
371 <emphasis>%Cred</emphasis>: switch color to red
\r
376 <emphasis>%Cgreen</emphasis>: switch color to green
\r
381 <emphasis>%Cblue</emphasis>: switch color to blue
\r
386 <emphasis>%Creset</emphasis>: reset color
\r
391 <emphasis>%C(…)</emphasis>: color specification, as described in color.branch.* config option
\r
396 <emphasis>%m</emphasis>: left, right or boundary mark
\r
401 <emphasis>%n</emphasis>: newline
\r
406 <emphasis>%x00</emphasis>: print a byte from a hex code
\r
413 <emphasis>tformat:</emphasis>
\r
415 <simpara>The <emphasis>tformat:</emphasis> format works exactly like <emphasis>format:</emphasis>, except that it
\r
416 provides "terminator" semantics instead of "separator" semantics. In
\r
417 other words, each commit has the message terminator character (usually a
\r
418 newline) appended, rather than a separator placed between entries.
\r
419 This means that the final entry of a single-line format will be properly
\r
420 terminated with a new line, just as the "oneline" format does.
\r
421 For example:</simpara>
\r
422 <literallayout>$ git log -2 --pretty=format:%h 4da45bef \
\r
423 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
\r
425 7134973 -- NO NEWLINE
\r
427 $ git log -2 --pretty=tformat:%h 4da45bef \
\r
428 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
\r
430 7134973</literallayout>
\r
434 <simplesect id="_examples">
\r
435 <title>Examples</title>
\r
439 git whatchanged -p v2.6.12.. include/scsi drivers/scsi
\r
443 Show as patches the commits since version <emphasis>v2.6.12</emphasis> that changed
\r
444 any file in the include/scsi or drivers/scsi subdirectories
\r
450 git whatchanged --since="2 weeks ago" -- gitk
\r
454 Show the changes during the last two weeks to the file <emphasis>gitk</emphasis>.
\r
455 The "--" is necessary to avoid confusion with the <emphasis role="strong">branch</emphasis> named
\r
456 <emphasis>gitk</emphasis>
\r
462 <simplesect id="_author">
\r
463 <title>Author</title>
\r
464 <simpara>Written by Linus Torvalds <<ulink url="mailto:torvalds@osdl.org">torvalds@osdl.org</ulink>> and
\r
465 Junio C Hamano <<ulink url="mailto:gitster@pobox.com">gitster@pobox.com</ulink>></simpara>
\r
467 <simplesect id="_documentation">
\r
468 <title>Documentation</title>
\r
469 <simpara>Documentation by David Greaves, Junio C Hamano and the git-list <<ulink url="mailto:git@vger.kernel.org">git@vger.kernel.org</ulink>>.</simpara>
\r
471 <simplesect id="_git">
\r
473 <simpara>Part of the <xref linkend="git(1)"/> suite</simpara>
\r