1GIT-WHATCHANGED(1) Git Manual GIT-WHATCHANGED(1)
2
3
4
6 git-whatchanged - Show logs with difference each commit introduces
7
9 git whatchanged <option>...
10
12 Shows commit logs and diff output each commit introduces. The command
13 internally invokes git rev-list piped to git diff-tree, and takes
14 command line options for both of these commands.
15
16 This manual page describes only the most frequently used options.
17
19 -p
20 Show textual diffs, instead of the git internal diff output format
21 that is useful only to tell the changed paths and their nature of
22 changes.
23
24 -<n>
25 Limit output to <n> commits.
26
27 <since>..<until>
28 Limit output to between the two named commits (bottom exclusive,
29 top inclusive).
30
31 -r
32 Show git internal diff output, but for the whole tree, not just the
33 top level.
34
35 -m
36 By default, differences for merge commits are not shown. With this
37 flag, show differences to that commit from all of its parents.
38
39 However, it is not very useful in general, although it is useful on
40 a file-by-file basis.
41
42 --pretty[=<format>], --format=<format>
43 Pretty-print the contents of the commit logs in a given format,
44 where <format> can be one of oneline, short, medium, full, fuller,
45 email, raw and format:<string>. See the "PRETTY FORMATS" section
46 for some additional details for each format. When omitted, the
47 format defaults to medium.
48
49 Note: you can specify the default pretty format in the repository
50 configuration (see git-config(1)).
51
52 --abbrev-commit
53 Instead of showing the full 40-byte hexadecimal commit object name,
54 show only a partial prefix. Non default number of digits can be
55 specified with "--abbrev=<n>" (which also modifies diff output, if
56 it is displayed).
57
58 This should make "--pretty=oneline" a whole lot more readable for
59 people using 80-column terminals.
60
61 --oneline
62 This is a shorthand for "--pretty=oneline --abbrev-commit" used
63 together.
64
65 --encoding[=<encoding>]
66 The commit objects record the encoding used for the log message in
67 their encoding header; this option can be used to tell the command
68 to re-code the commit log message in the encoding preferred by the
69 user. For non plumbing commands this defaults to UTF-8.
70
71 --no-notes, --show-notes[=<ref>]
72 Show the notes (see git-notes(1)) that annotate the commit, when
73 showing the commit log message. This is the default for git log,
74 git show and git whatchanged commands when there is no --pretty,
75 --format nor --oneline option is given on the command line.
76
77 With an optional argument, add this ref to the list of notes. The
78 ref is taken to be in refs/notes/ if it is not qualified.
79
80 --[no-]standard-notes
81 Enable or disable populating the notes ref list from the
82 core.notesRef and notes.displayRef variables (or corresponding
83 environment overrides). Enabled by default. See git-config(1).
84
86 If the commit is a merge, and if the pretty-format is not oneline,
87 email or raw, an additional line is inserted before the Author: line.
88 This line begins with "Merge: " and the sha1s of ancestral commits are
89 printed, separated by spaces. Note that the listed commits may not
90 necessarily be the list of the direct parent commits if you have
91 limited your view of history: for example, if you are only interested
92 in changes related to a certain directory or file.
93
94 There are several built-in formats, and you can define additional
95 formats by setting a pretty.<name> config option to either another
96 format name, or a format: string, as described below (see git-
97 config(1)). Here are the details of the built-in formats:
98
99 · oneline
100
101 <sha1> <title line>
102
103 This is designed to be as compact as possible.
104
105 · short
106
107 commit <sha1>
108 Author: <author>
109
110 <title line>
111
112 · medium
113
114 commit <sha1>
115 Author: <author>
116 Date: <author date>
117
118 <title line>
119
120 <full commit message>
121
122 · full
123
124 commit <sha1>
125 Author: <author>
126 Commit: <committer>
127
128 <title line>
129
130 <full commit message>
131
132 · fuller
133
134 commit <sha1>
135 Author: <author>
136 AuthorDate: <author date>
137 Commit: <committer>
138 CommitDate: <committer date>
139
140 <title line>
141
142 <full commit message>
143
144 · email
145
146 From <sha1> <date>
147 From: <author>
148 Date: <author date>
149 Subject: [PATCH] <title line>
150
151 <full commit message>
152
153 · raw
154
155 The raw format shows the entire commit exactly as stored in the
156 commit object. Notably, the SHA1s are displayed in full, regardless
157 of whether --abbrev or --no-abbrev are used, and parents
158 information show the true parent commits, without taking grafts nor
159 history simplification into account.
160
161 · format:<string>
162
163 The format:<string> format allows you to specify which information
164 you want to show. It works a little bit like printf format, with
165 the notable exception that you get a newline with %n instead of \n.
166
167 E.g, format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"
168 would show something like this:
169
170 The author of fe6e0ee was Junio C Hamano, 23 hours ago
171 The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<
172
173 The placeholders are:
174
175 · %H: commit hash
176
177 · %h: abbreviated commit hash
178
179 · %T: tree hash
180
181 · %t: abbreviated tree hash
182
183 · %P: parent hashes
184
185 · %p: abbreviated parent hashes
186
187 · %an: author name
188
189 · %aN: author name (respecting .mailmap, see git-shortlog(1) or
190 git-blame(1))
191
192 · %ae: author email
193
194 · %aE: author email (respecting .mailmap, see git-shortlog(1) or
195 git-blame(1))
196
197 · %ad: author date (format respects --date= option)
198
199 · %aD: author date, RFC2822 style
200
201 · %ar: author date, relative
202
203 · %at: author date, UNIX timestamp
204
205 · %ai: author date, ISO 8601 format
206
207 · %cn: committer name
208
209 · %cN: committer name (respecting .mailmap, see git-shortlog(1)
210 or git-blame(1))
211
212 · %ce: committer email
213
214 · %cE: committer email (respecting .mailmap, see git-shortlog(1)
215 or git-blame(1))
216
217 · %cd: committer date
218
219 · %cD: committer date, RFC2822 style
220
221 · %cr: committer date, relative
222
223 · %ct: committer date, UNIX timestamp
224
225 · %ci: committer date, ISO 8601 format
226
227 · %d: ref names, like the --decorate option of git-log(1)
228
229 · %e: encoding
230
231 · %s: subject
232
233 · %f: sanitized subject line, suitable for a filename
234
235 · %b: body
236
237 · %B: raw body (unwrapped subject and body)
238
239 · %N: commit notes
240
241 · %gD: reflog selector, e.g., refs/stash@{1}
242
243 · %gd: shortened reflog selector, e.g., stash@{1}
244
245 · %gs: reflog subject
246
247 · %Cred: switch color to red
248
249 · %Cgreen: switch color to green
250
251 · %Cblue: switch color to blue
252
253 · %Creset: reset color
254
255 · %C(...): color specification, as described in color.branch.*
256 config option
257
258 · %m: left, right or boundary mark
259
260 · %n: newline
261
262 · %%: a raw %
263
264 · %x00: print a byte from a hex code
265
266 · %w([<w>[,<i1>[,<i2>]]]): switch line wrapping, like the -w
267 option of git-shortlog(1).
268
269 Note
270 Some placeholders may depend on other options given to the revision
271 traversal engine. For example, the %g* reflog options will insert
272 an empty string unless we are traversing reflog entries (e.g., by
273 git log -g). The %d placeholder will use the "short" decoration
274 format if --decorate was not already provided on the command line.
275
276 If you add a + (plus sign) after % of a placeholder, a line-feed is
277 inserted immediately before the expansion if and only if the
278 placeholder expands to a non-empty string.
279
280 If you add a - (minus sign) after % of a placeholder, line-feeds that
281 immediately precede the expansion are deleted if and only if the
282 placeholder expands to an empty string.
283
284 If you add a ` ` (space) after % of a placeholder, a space is inserted
285 immediately before the expansion if and only if the placeholder expands
286 to a non-empty string.
287
288 · tformat:
289
290 The tformat: format works exactly like format:, except that it
291 provides "terminator" semantics instead of "separator" semantics.
292 In other words, each commit has the message terminator character
293 (usually a newline) appended, rather than a separator placed
294 between entries. This means that the final entry of a single-line
295 format will be properly terminated with a new line, just as the
296 "oneline" format does. For example:
297
298 $ git log -2 --pretty=format:%h 4da45bef \
299 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
300 4da45be
301 7134973 -- NO NEWLINE
302
303 $ git log -2 --pretty=tformat:%h 4da45bef \
304 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
305 4da45be
306 7134973
307
308 In addition, any unrecognized string that has a % in it is
309 interpreted as if it has tformat: in front of it. For example,
310 these two are equivalent:
311
312 $ git log -2 --pretty=tformat:%h 4da45bef
313 $ git log -2 --pretty=%h 4da45bef
314
315
317 git whatchanged -p v2.6.12.. include/scsi drivers/scsi
318 Show as patches the commits since version v2.6.12 that changed any
319 file in the include/scsi or drivers/scsi subdirectories
320
321 git whatchanged --since="2 weeks ago" -- gitk
322 Show the changes during the last two weeks to the file gitk. The
323 "--" is necessary to avoid confusion with the branch named gitk
324
326 Written by Linus Torvalds <torvalds@osdl.org[1]> and Junio C Hamano
327 <gitster@pobox.com[2]>
328
330 Documentation by David Greaves, Junio C Hamano and the git-list
331 <git@vger.kernel.org[3]>.
332
334 Part of the git(1) suite
335
337 1. torvalds@osdl.org
338 mailto:torvalds@osdl.org
339
340 2. gitster@pobox.com
341 mailto:gitster@pobox.com
342
343 3. git@vger.kernel.org
344 mailto:git@vger.kernel.org
345
346
347
348Git 1.7.4.4 04/11/2011 GIT-WHATCHANGED(1)