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