]>
Commit | Line | Data |
---|---|---|
fdcf39e5 MV |
1 | Commit Limiting |
2 | ~~~~~~~~~~~~~~~ | |
3 | ||
4 | Besides specifying a range of commits that should be listed using the | |
5 | special notations explained in the description, additional commit | |
190767f6 MG |
6 | limiting may be applied. Note that they are applied before commit |
7 | ordering and formatting options, such as '--reverse'. | |
fdcf39e5 MV |
8 | |
9 | -- | |
10 | ||
3240240f | 11 | -n 'number':: |
982962ce | 12 | --max-count=<number>:: |
fdcf39e5 | 13 | |
841d8118 | 14 | Limit the number of commits to output. |
fdcf39e5 | 15 | |
982962ce | 16 | --skip=<number>:: |
fdcf39e5 MV |
17 | |
18 | Skip 'number' commits before starting to show the commit output. | |
19 | ||
982962ce MM |
20 | --since=<date>:: |
21 | --after=<date>:: | |
fdcf39e5 MV |
22 | |
23 | Show commits more recent than a specific date. | |
24 | ||
982962ce MM |
25 | --until=<date>:: |
26 | --before=<date>:: | |
fdcf39e5 MV |
27 | |
28 | Show commits older than a specific date. | |
29 | ||
56b6d01d | 30 | ifdef::git-rev-list[] |
982962ce MM |
31 | --max-age=<timestamp>:: |
32 | --min-age=<timestamp>:: | |
fdcf39e5 MV |
33 | |
34 | Limit the commits output to specified time range. | |
56b6d01d | 35 | endif::git-rev-list[] |
fdcf39e5 | 36 | |
982962ce MM |
37 | --author=<pattern>:: |
38 | --committer=<pattern>:: | |
fdcf39e5 MV |
39 | |
40 | Limit the commits output to ones with author/committer | |
41 | header lines that match the specified pattern (regular expression). | |
42 | ||
982962ce | 43 | --grep=<pattern>:: |
fdcf39e5 MV |
44 | |
45 | Limit the commits output to ones with log message that | |
46 | matches the specified pattern (regular expression). | |
47 | ||
7756ba74 MM |
48 | --all-match:: |
49 | Limit the commits output to ones that match all given --grep, | |
50 | --author and --committer instead of ones that match at least one. | |
51 | ||
3240240f SB |
52 | -i:: |
53 | --regexp-ignore-case:: | |
fdcf39e5 MV |
54 | |
55 | Match the regexp limiting patterns without regard to letters case. | |
56 | ||
3240240f SB |
57 | -E:: |
58 | --extended-regexp:: | |
fdcf39e5 MV |
59 | |
60 | Consider the limiting patterns to be extended regular expressions | |
61 | instead of the default basic regular expressions. | |
62 | ||
3240240f SB |
63 | -F:: |
64 | --fixed-strings:: | |
dc1c0fff JN |
65 | |
66 | Consider the limiting patterns to be fixed strings (don't interpret | |
67 | pattern as a regular expression). | |
68 | ||
fdcf39e5 MV |
69 | --remove-empty:: |
70 | ||
71 | Stop when a given path disappears from the tree. | |
72 | ||
2657420d SG |
73 | --merges:: |
74 | ||
6a6ebded | 75 | Print only merge commits. This is exactly the same as `--min-parents=2`. |
2657420d | 76 | |
fdcf39e5 MV |
77 | --no-merges:: |
78 | ||
6a6ebded MG |
79 | Do not print commits with more than one parent. This is |
80 | exactly the same as `--max-parents=1`. | |
81 | ||
82 | --min-parents=<number>:: | |
83 | --max-parents=<number>:: | |
84 | --no-min-parents:: | |
85 | --no-max-parents:: | |
86 | ||
87 | Show only commits which have at least (or at most) that many | |
88 | commits. In particular, `--max-parents=1` is the same as `--no-merges`, | |
89 | `--min-parents=2` is the same as `--merges`. `--max-parents=0` | |
90 | gives all root commits and `--min-parents=3` all octopus merges. | |
91 | + | |
92 | `--no-min-parents` and `--no-max-parents` reset these limits (to no limit) | |
93 | again. Equivalent forms are `--min-parents=0` (any commit has 0 or more | |
94 | parents) and `--max-parents=-1` (negative numbers denote no upper limit). | |
fdcf39e5 MV |
95 | |
96 | --first-parent:: | |
97 | Follow only the first parent commit upon seeing a merge | |
98 | commit. This option can give a better overview when | |
99 | viewing the evolution of a particular topic branch, | |
100 | because merges into a topic branch tend to be only about | |
101 | adjusting to updated upstream from time to time, and | |
102 | this option allows you to ignore the individual commits | |
103 | brought in to your history by such a merge. | |
104 | ||
105 | --not:: | |
106 | ||
107 | Reverses the meaning of the '{caret}' prefix (or lack thereof) | |
108 | for all following revision specifiers, up to the next '--not'. | |
109 | ||
110 | --all:: | |
111 | ||
cc1b8d8b | 112 | Pretend as if all the refs in `refs/` are listed on the |
fdcf39e5 | 113 | command line as '<commit>'. |
c2e6385d | 114 | |
62b4698e | 115 | --branches[=<pattern>]:: |
c2e6385d | 116 | |
cc1b8d8b | 117 | Pretend as if all the refs in `refs/heads` are listed |
62b4698e | 118 | on the command line as '<commit>'. If '<pattern>' is given, limit |
b09fe971 | 119 | branches to ones matching given shell glob. If pattern lacks '?', |
e34bb2e7 | 120 | '{asterisk}', or '[', '/{asterisk}' at the end is implied. |
c2e6385d | 121 | |
62b4698e | 122 | --tags[=<pattern>]:: |
c2e6385d | 123 | |
cc1b8d8b | 124 | Pretend as if all the refs in `refs/tags` are listed |
62b4698e | 125 | on the command line as '<commit>'. If '<pattern>' is given, limit |
e34bb2e7 CMN |
126 | tags to ones matching given shell glob. If pattern lacks '?', '{asterisk}', |
127 | or '[', '/{asterisk}' at the end is implied. | |
c2e6385d | 128 | |
62b4698e | 129 | --remotes[=<pattern>]:: |
c2e6385d | 130 | |
cc1b8d8b | 131 | Pretend as if all the refs in `refs/remotes` are listed |
62b4698e | 132 | on the command line as '<commit>'. If '<pattern>' is given, limit |
0e615b25 | 133 | remote-tracking branches to ones matching given shell glob. |
e34bb2e7 | 134 | If pattern lacks '?', '{asterisk}', or '[', '/{asterisk}' at the end is implied. |
fdcf39e5 | 135 | |
62b4698e ŠN |
136 | --glob=<glob-pattern>:: |
137 | Pretend as if all the refs matching shell glob '<glob-pattern>' | |
d08bae7e | 138 | are listed on the command line as '<commit>'. Leading 'refs/', |
e34bb2e7 CMN |
139 | is automatically prepended if missing. If pattern lacks '?', '{asterisk}', |
140 | or '[', '/{asterisk}' at the end is implied. | |
d08bae7e | 141 | |
cc243c3c JH |
142 | --ignore-missing:: |
143 | ||
144 | Upon seeing an invalid object name in the input, pretend as if | |
145 | the bad input was not given. | |
d08bae7e | 146 | |
af06e93a CC |
147 | ifndef::git-rev-list[] |
148 | --bisect:: | |
149 | ||
cc1b8d8b | 150 | Pretend as if the bad bisection ref `refs/bisect/bad` |
af06e93a | 151 | was listed and as if it was followed by `--not` and the good |
cc1b8d8b | 152 | bisection refs `refs/bisect/good-*` on the command |
af06e93a CC |
153 | line. |
154 | endif::git-rev-list[] | |
155 | ||
fdcf39e5 MV |
156 | --stdin:: |
157 | ||
158 | In addition to the '<commit>' listed on the command | |
60da8b15 JH |
159 | line, read them from the standard input. If a '--' separator is |
160 | seen, stop reading commits and start reading paths to limit the | |
161 | result. | |
fdcf39e5 | 162 | |
8b3dce56 | 163 | ifdef::git-rev-list[] |
fdcf39e5 MV |
164 | --quiet:: |
165 | ||
166 | Don't print anything to standard output. This form | |
167 | is primarily meant to allow the caller to | |
168 | test the exit status to see if a range of objects is fully | |
169 | connected (or not). It is faster than redirecting stdout | |
170 | to /dev/null as the output does not have to be formatted. | |
adf60f14 | 171 | endif::git-rev-list[] |
fdcf39e5 | 172 | |
cb56e309 MG |
173 | --cherry-mark:: |
174 | ||
175 | Like `--cherry-pick` (see below) but mark equivalent commits | |
176 | with `=` rather than omitting them, and inequivalent ones with `+`. | |
177 | ||
fdcf39e5 MV |
178 | --cherry-pick:: |
179 | ||
180 | Omit any commit that introduces the same change as | |
181 | another commit on the "other side" when the set of | |
182 | commits are limited with symmetric difference. | |
183 | + | |
184 | For example, if you have two branches, `A` and `B`, a usual way | |
185 | to list all commits on only one side of them is with | |
3add01bb JH |
186 | `--left-right` (see the example below in the description of |
187 | the `--left-right` option). It however shows the commits that were cherry-picked | |
fdcf39e5 MV |
188 | from the other branch (for example, "3rd on b" may be cherry-picked |
189 | from branch A). With this option, such pairs of commits are | |
190 | excluded from the output. | |
191 | ||
59c8afdf MG |
192 | --left-only:: |
193 | --right-only:: | |
194 | ||
195 | List only commits on the respective side of a symmetric range, | |
196 | i.e. only those which would be marked `<` resp. `>` by | |
197 | `--left-right`. | |
198 | + | |
199 | For example, `--cherry-pick --right-only A...B` omits those | |
200 | commits from `B` which are in `A` or are patch-equivalent to a commit in | |
6cf378f0 | 201 | `A`. In other words, this lists the `+` commits from `git cherry A B`. |
59c8afdf MG |
202 | More precisely, `--cherry-pick --right-only --no-merges` gives the exact |
203 | list. | |
204 | ||
94f605ec MG |
205 | --cherry:: |
206 | ||
207 | A synonym for `--right-only --cherry-mark --no-merges`; useful to | |
208 | limit the output to the commits on our side and mark those that | |
209 | have been applied to the other side of a forked history with | |
210 | `git log --cherry upstream...mybranch`, similar to | |
211 | `git cherry upstream mybranch`. | |
212 | ||
3240240f SB |
213 | -g:: |
214 | --walk-reflogs:: | |
fdcf39e5 MV |
215 | |
216 | Instead of walking the commit ancestry chain, walk | |
217 | reflog entries from the most recent one to older ones. | |
218 | When this option is used you cannot specify commits to | |
219 | exclude (that is, '{caret}commit', 'commit1..commit2', | |
b9190e79 | 220 | nor 'commit1\...commit2' notations cannot be used). |
fdcf39e5 MV |
221 | + |
222 | With '\--pretty' format other than oneline (for obvious reasons), | |
223 | this causes the output to have two extra lines of information | |
224 | taken from the reflog. By default, 'commit@\{Nth}' notation is | |
225 | used in the output. When the starting commit is specified as | |
18a2197e | 226 | 'commit@\{now}', output also uses 'commit@\{timestamp}' notation |
fdcf39e5 MV |
227 | instead. Under '\--pretty=oneline', the commit message is |
228 | prefixed with this information on the same line. | |
e534735a | 229 | This option cannot be combined with '\--reverse'. |
fdcf39e5 MV |
230 | See also linkgit:git-reflog[1]. |
231 | ||
232 | --merge:: | |
233 | ||
234 | After a failed merge, show refs that touch files having a | |
235 | conflict and don't exist on all heads to merge. | |
236 | ||
237 | --boundary:: | |
238 | ||
239 | Output uninteresting commits at the boundary, which are usually | |
240 | not shown. | |
241 | ||
70d9895e TR |
242 | -- |
243 | ||
244 | History Simplification | |
245 | ~~~~~~~~~~~~~~~~~~~~~~ | |
246 | ||
7bc2508b SB |
247 | Sometimes you are only interested in parts of the history, for example the |
248 | commits modifying a particular <path>. But there are two parts of | |
249 | 'History Simplification', one part is selecting the commits and the other | |
250 | is how to do it, as there are various strategies to simplify the history. | |
251 | ||
252 | The following options select the commits to be shown: | |
253 | ||
254 | <paths>:: | |
255 | ||
256 | Commits modifying the given <paths> are selected. | |
257 | ||
258 | --simplify-by-decoration:: | |
259 | ||
260 | Commits that are referred by some branch or tag are selected. | |
261 | ||
262 | Note that extra commits can be shown to give a meaningful history. | |
263 | ||
264 | The following options affect the way the simplification is performed: | |
265 | ||
266 | Default mode:: | |
267 | ||
268 | Simplifies the history to the simplest history explaining the | |
269 | final state of the tree. Simplest because it prunes some side | |
270 | branches if the end result is the same (i.e. merging branches | |
271 | with the same content) | |
272 | ||
273 | --full-history:: | |
274 | ||
df6b0cad | 275 | Same as the default mode, but does not prune some history. |
7bc2508b SB |
276 | |
277 | --dense:: | |
278 | ||
279 | Only the selected commits are shown, plus some to have a | |
280 | meaningful history. | |
281 | ||
282 | --sparse:: | |
283 | ||
284 | All commits in the simplified history are shown. | |
285 | ||
286 | --simplify-merges:: | |
287 | ||
288 | Additional option to '--full-history' to remove some needless | |
289 | merges from the resulting history, as there are no selected | |
290 | commits contributing to this merge. | |
291 | ||
57456ef4 JH |
292 | --ancestry-path:: |
293 | ||
294 | When given a range of commits to display (e.g. 'commit1..commit2' | |
295 | or 'commit2 {caret}commit1'), only display commits that exist | |
296 | directly on the ancestry chain between the 'commit1' and | |
297 | 'commit2', i.e. commits that are both descendants of 'commit1', | |
298 | and ancestors of 'commit2'. | |
299 | ||
7bc2508b | 300 | A more detailed explanation follows. |
70d9895e TR |
301 | |
302 | Suppose you specified `foo` as the <paths>. We shall call commits | |
303 | that modify `foo` !TREESAME, and the rest TREESAME. (In a diff | |
304 | filtered for `foo`, they look different and equal, respectively.) | |
305 | ||
306 | In the following, we will always refer to the same example history to | |
307 | illustrate the differences between simplification settings. We assume | |
308 | that you are filtering for a file `foo` in this commit graph: | |
309 | ----------------------------------------------------------------------- | |
310 | .-A---M---N---O---P | |
311 | / / / / / | |
312 | I B C D E | |
313 | \ / / / / | |
314 | `-------------' | |
315 | ----------------------------------------------------------------------- | |
565e135a | 316 | The horizontal line of history A---P is taken to be the first parent of |
70d9895e TR |
317 | each merge. The commits are: |
318 | ||
319 | * `I` is the initial commit, in which `foo` exists with contents | |
320 | "asdf", and a file `quux` exists with contents "quux". Initial | |
321 | commits are compared to an empty tree, so `I` is !TREESAME. | |
322 | ||
323 | * In `A`, `foo` contains just "foo". | |
324 | ||
325 | * `B` contains the same change as `A`. Its merge `M` is trivial and | |
326 | hence TREESAME to all parents. | |
327 | ||
328 | * `C` does not change `foo`, but its merge `N` changes it to "foobar", | |
329 | so it is not TREESAME to any parent. | |
330 | ||
331 | * `D` sets `foo` to "baz". Its merge `O` combines the strings from | |
332 | `N` and `D` to "foobarbaz"; i.e., it is not TREESAME to any parent. | |
333 | ||
334 | * `E` changes `quux` to "xyzzy", and its merge `P` combines the | |
335 | strings to "quux xyzzy". Despite appearing interesting, `P` is | |
336 | TREESAME to all parents. | |
337 | ||
338 | 'rev-list' walks backwards through history, including or excluding | |
339 | commits based on whether '\--full-history' and/or parent rewriting | |
340 | (via '\--parents' or '\--children') are used. The following settings | |
341 | are available. | |
342 | ||
343 | Default mode:: | |
344 | ||
345 | Commits are included if they are not TREESAME to any parent | |
346 | (though this can be changed, see '\--sparse' below). If the | |
347 | commit was a merge, and it was TREESAME to one parent, follow | |
348 | only that parent. (Even if there are several TREESAME | |
349 | parents, follow only one of them.) Otherwise, follow all | |
350 | parents. | |
351 | + | |
352 | This results in: | |
353 | + | |
354 | ----------------------------------------------------------------------- | |
355 | .-A---N---O | |
f70d0586 | 356 | / / / |
70d9895e TR |
357 | I---------D |
358 | ----------------------------------------------------------------------- | |
359 | + | |
360 | Note how the rule to only follow the TREESAME parent, if one is | |
361 | available, removed `B` from consideration entirely. `C` was | |
362 | considered via `N`, but is TREESAME. Root commits are compared to an | |
363 | empty tree, so `I` is !TREESAME. | |
364 | + | |
365 | Parent/child relations are only visible with --parents, but that does | |
366 | not affect the commits selected in default mode, so we have shown the | |
367 | parent lines. | |
368 | ||
369 | --full-history without parent rewriting:: | |
370 | ||
371 | This mode differs from the default in one point: always follow | |
372 | all parents of a merge, even if it is TREESAME to one of them. | |
373 | Even if more than one side of the merge has commits that are | |
374 | included, this does not imply that the merge itself is! In | |
375 | the example, we get | |
376 | + | |
377 | ----------------------------------------------------------------------- | |
378 | I A B N D O | |
379 | ----------------------------------------------------------------------- | |
380 | + | |
381 | `P` and `M` were excluded because they are TREESAME to a parent. `E`, | |
382 | `C` and `B` were all walked, but only `B` was !TREESAME, so the others | |
383 | do not appear. | |
384 | + | |
385 | Note that without parent rewriting, it is not really possible to talk | |
386 | about the parent/child relationships between the commits, so we show | |
387 | them disconnected. | |
388 | ||
389 | --full-history with parent rewriting:: | |
390 | ||
391 | Ordinary commits are only included if they are !TREESAME | |
392 | (though this can be changed, see '\--sparse' below). | |
393 | + | |
394 | Merges are always included. However, their parent list is rewritten: | |
395 | Along each parent, prune away commits that are not included | |
396 | themselves. This results in | |
397 | + | |
398 | ----------------------------------------------------------------------- | |
399 | .-A---M---N---O---P | |
400 | / / / / / | |
401 | I B / D / | |
402 | \ / / / / | |
403 | `-------------' | |
404 | ----------------------------------------------------------------------- | |
405 | + | |
406 | Compare to '\--full-history' without rewriting above. Note that `E` | |
407 | was pruned away because it is TREESAME, but the parent list of P was | |
408 | rewritten to contain `E`'s parent `I`. The same happened for `C` and | |
409 | `N`. Note also that `P` was included despite being TREESAME. | |
410 | ||
411 | In addition to the above settings, you can change whether TREESAME | |
412 | affects inclusion: | |
413 | ||
3240240f | 414 | --dense:: |
70d9895e TR |
415 | |
416 | Commits that are walked are included if they are not TREESAME | |
417 | to any parent. | |
418 | ||
3240240f | 419 | --sparse:: |
fdcf39e5 | 420 | |
70d9895e TR |
421 | All commits that are walked are included. |
422 | + | |
423 | Note that without '\--full-history', this still simplifies merges: if | |
424 | one of the parents is TREESAME, we follow only that one, so the other | |
425 | sides of the merge are never walked. | |
fdcf39e5 | 426 | |
d266a988 TR |
427 | --simplify-merges:: |
428 | ||
429 | First, build a history graph in the same way that | |
430 | '\--full-history' with parent rewriting does (see above). | |
431 | + | |
432 | Then simplify each commit `C` to its replacement `C'` in the final | |
433 | history according to the following rules: | |
434 | + | |
435 | -- | |
436 | * Set `C'` to `C`. | |
437 | + | |
438 | * Replace each parent `P` of `C'` with its simplification `P'`. In | |
439 | the process, drop parents that are ancestors of other parents, and | |
440 | remove duplicates. | |
441 | + | |
442 | * If after this parent rewriting, `C'` is a root or merge commit (has | |
443 | zero or >1 parents), a boundary commit, or !TREESAME, it remains. | |
444 | Otherwise, it is replaced with its only parent. | |
445 | -- | |
446 | + | |
447 | The effect of this is best shown by way of comparing to | |
448 | '\--full-history' with parent rewriting. The example turns into: | |
449 | + | |
450 | ----------------------------------------------------------------------- | |
451 | .-A---M---N---O | |
452 | / / / | |
453 | I B D | |
454 | \ / / | |
455 | `---------' | |
456 | ----------------------------------------------------------------------- | |
457 | + | |
6cf378f0 | 458 | Note the major differences in `N` and `P` over '--full-history': |
d266a988 TR |
459 | + |
460 | -- | |
461 | * `N`'s parent list had `I` removed, because it is an ancestor of the | |
462 | other parent `M`. Still, `N` remained because it is !TREESAME. | |
463 | + | |
464 | * `P`'s parent list similarly had `I` removed. `P` was then | |
465 | removed completely, because it had one parent and is TREESAME. | |
466 | -- | |
fdcf39e5 | 467 | |
57456ef4 JH |
468 | Finally, there is a fifth simplification mode available: |
469 | ||
470 | --ancestry-path:: | |
471 | ||
472 | Limit the displayed commits to those directly on the ancestry | |
473 | chain between the "from" and "to" commits in the given commit | |
474 | range. I.e. only display commits that are ancestor of the "to" | |
475 | commit, and descendants of the "from" commit. | |
476 | + | |
477 | As an example use case, consider the following commit history: | |
478 | + | |
479 | ----------------------------------------------------------------------- | |
480 | D---E-------F | |
481 | / \ \ | |
482 | B---C---G---H---I---J | |
483 | / \ | |
484 | A-------K---------------L--M | |
485 | ----------------------------------------------------------------------- | |
486 | + | |
487 | A regular 'D..M' computes the set of commits that are ancestors of `M`, | |
488 | but excludes the ones that are ancestors of `D`. This is useful to see | |
489 | what happened to the history leading to `M` since `D`, in the sense | |
490 | that "what does `M` have that did not exist in `D`". The result in this | |
491 | example would be all the commits, except `A` and `B` (and `D` itself, | |
492 | of course). | |
493 | + | |
494 | When we want to find out what commits in `M` are contaminated with the | |
495 | bug introduced by `D` and need fixing, however, we might want to view | |
496 | only the subset of 'D..M' that are actually descendants of `D`, i.e. | |
6cf378f0 | 497 | excluding `C` and `K`. This is exactly what the '--ancestry-path' |
57456ef4 JH |
498 | option does. Applied to the 'D..M' range, it results in: |
499 | + | |
500 | ----------------------------------------------------------------------- | |
501 | E-------F | |
502 | \ \ | |
503 | G---H---I---J | |
504 | \ | |
505 | L--M | |
506 | ----------------------------------------------------------------------- | |
507 | ||
3fcfd662 NS |
508 | The '\--simplify-by-decoration' option allows you to view only the |
509 | big picture of the topology of the history, by omitting commits | |
510 | that are not referenced by tags. Commits are marked as !TREESAME | |
511 | (in other words, kept after history simplification rules described | |
512 | above) if (1) they are referenced by tags, or (2) they change the | |
513 | contents of the paths given on the command line. All other | |
514 | commits are marked as TREESAME (subject to be simplified away). | |
515 | ||
fdcf39e5 | 516 | ifdef::git-rev-list[] |
70d9895e TR |
517 | Bisection Helpers |
518 | ~~~~~~~~~~~~~~~~~ | |
519 | ||
fdcf39e5 MV |
520 | --bisect:: |
521 | ||
522 | Limit output to the one commit object which is roughly halfway between | |
af06e93a | 523 | included and excluded commits. Note that the bad bisection ref |
cc1b8d8b JK |
524 | `refs/bisect/bad` is added to the included commits (if it |
525 | exists) and the good bisection refs `refs/bisect/good-*` are | |
af06e93a | 526 | added to the excluded commits (if they exist). Thus, supposing there |
cc1b8d8b | 527 | are no refs in `refs/bisect/`, if |
fdcf39e5 MV |
528 | |
529 | ----------------------------------------------------------------------- | |
6514aa36 | 530 | $ git rev-list --bisect foo ^bar ^baz |
fdcf39e5 MV |
531 | ----------------------------------------------------------------------- |
532 | ||
533 | outputs 'midpoint', the output of the two commands | |
534 | ||
535 | ----------------------------------------------------------------------- | |
6514aa36 CC |
536 | $ git rev-list foo ^midpoint |
537 | $ git rev-list midpoint ^bar ^baz | |
fdcf39e5 MV |
538 | ----------------------------------------------------------------------- |
539 | ||
540 | would be of roughly the same length. Finding the change which | |
541 | introduces a regression is thus reduced to a binary search: repeatedly | |
542 | generate and test new 'midpoint's until the commit chain is of length | |
543 | one. | |
544 | ||
545 | --bisect-vars:: | |
546 | ||
af06e93a | 547 | This calculates the same as `--bisect`, except that refs in |
cc1b8d8b | 548 | `refs/bisect/` are not used, and except that this outputs |
af06e93a CC |
549 | text ready to be eval'ed by the shell. These lines will assign the |
550 | name of the midpoint revision to the variable `bisect_rev`, and the | |
551 | expected number of commits to be tested after `bisect_rev` is tested | |
552 | to `bisect_nr`, the expected number of commits to be tested if | |
553 | `bisect_rev` turns out to be good to `bisect_good`, the expected | |
554 | number of commits to be tested if `bisect_rev` turns out to be bad to | |
555 | `bisect_bad`, and the number of commits we are bisecting right now to | |
556 | `bisect_all`. | |
fdcf39e5 MV |
557 | |
558 | --bisect-all:: | |
559 | ||
560 | This outputs all the commit objects between the included and excluded | |
561 | commits, ordered by their distance to the included and excluded | |
cc1b8d8b | 562 | commits. Refs in `refs/bisect/` are not used. The farthest |
af06e93a CC |
563 | from them is displayed first. (This is the only one displayed by |
564 | `--bisect`.) | |
3d2d4f96 | 565 | + |
fdcf39e5 MV |
566 | This is useful because it makes it easy to choose a good commit to |
567 | test when you want to avoid to test some of them for some reason (they | |
568 | may not compile for example). | |
3d2d4f96 | 569 | + |
fdcf39e5 MV |
570 | This option can be used along with `--bisect-vars`, in this case, |
571 | after all the sorted commit objects, there will be the same text as if | |
572 | `--bisect-vars` had been used alone. | |
573 | endif::git-rev-list[] | |
574 | ||
fdcf39e5 MV |
575 | |
576 | Commit Ordering | |
577 | ~~~~~~~~~~~~~~~ | |
578 | ||
579 | By default, the commits are shown in reverse chronological order. | |
580 | ||
581 | --topo-order:: | |
582 | ||
583 | This option makes them appear in topological order (i.e. | |
584 | descendant commits are shown before their parents). | |
585 | ||
586 | --date-order:: | |
587 | ||
588 | This option is similar to '--topo-order' in the sense that no | |
589 | parent comes before all of its children, but otherwise things | |
590 | are still ordered in the commit timestamp order. | |
591 | ||
592 | --reverse:: | |
593 | ||
594 | Output the commits in reverse order. | |
595 | Cannot be combined with '\--walk-reflogs'. | |
596 | ||
597 | Object Traversal | |
598 | ~~~~~~~~~~~~~~~~ | |
599 | ||
600 | These options are mostly targeted for packing of git repositories. | |
601 | ||
602 | --objects:: | |
603 | ||
604 | Print the object IDs of any object referenced by the listed | |
605 | commits. '--objects foo ^bar' thus means "send me | |
606 | all object IDs which I need to download if I have the commit | |
607 | object 'bar', but not 'foo'". | |
608 | ||
609 | --objects-edge:: | |
610 | ||
611 | Similar to '--objects', but also print the IDs of excluded | |
612 | commits prefixed with a "-" character. This is used by | |
613 | linkgit:git-pack-objects[1] to build "thin" pack, which records | |
614 | objects in deltified form based on objects contained in these | |
615 | excluded commits to reduce network traffic. | |
616 | ||
617 | --unpacked:: | |
618 | ||
619 | Only useful with '--objects'; print the object IDs that are not | |
620 | in packs. | |
621 | ||
622 | --no-walk:: | |
623 | ||
624 | Only show the given revs, but do not traverse their ancestors. | |
42939f1a | 625 | This has no effect if a range is specified. |
fdcf39e5 MV |
626 | |
627 | --do-walk:: | |
628 | ||
629 | Overrides a previous --no-walk. | |
f98fd436 MG |
630 | |
631 | Commit Formatting | |
632 | ~~~~~~~~~~~~~~~~~ | |
633 | ||
634 | ifdef::git-rev-list[] | |
635 | Using these options, linkgit:git-rev-list[1] will act similar to the | |
636 | more specialized family of commit log tools: linkgit:git-log[1], | |
637 | linkgit:git-show[1], and linkgit:git-whatchanged[1] | |
638 | endif::git-rev-list[] | |
639 | ||
640 | include::pretty-options.txt[] | |
641 | ||
642 | --relative-date:: | |
643 | ||
644 | Synonym for `--date=relative`. | |
645 | ||
646 | --date=(relative|local|default|iso|rfc|short|raw):: | |
647 | ||
648 | Only takes effect for dates shown in human-readable format, such | |
649 | as when using "--pretty". `log.date` config variable sets a default | |
650 | value for log command's --date option. | |
651 | + | |
652 | `--date=relative` shows dates relative to the current time, | |
653 | e.g. "2 hours ago". | |
654 | + | |
655 | `--date=local` shows timestamps in user's local timezone. | |
656 | + | |
657 | `--date=iso` (or `--date=iso8601`) shows timestamps in ISO 8601 format. | |
658 | + | |
659 | `--date=rfc` (or `--date=rfc2822`) shows timestamps in RFC 2822 | |
660 | format, often found in E-mail messages. | |
661 | + | |
662 | `--date=short` shows only date but not time, in `YYYY-MM-DD` format. | |
663 | + | |
664 | `--date=raw` shows the date in the internal raw git format `%s %z` format. | |
665 | + | |
666 | `--date=default` shows timestamps in the original timezone | |
667 | (either committer's or author's). | |
668 | ||
669 | ifdef::git-rev-list[] | |
670 | --header:: | |
671 | ||
672 | Print the contents of the commit in raw-format; each record is | |
673 | separated with a NUL character. | |
674 | endif::git-rev-list[] | |
675 | ||
676 | --parents:: | |
677 | ||
678 | Print also the parents of the commit (in the form "commit parent..."). | |
679 | Also enables parent rewriting, see 'History Simplification' below. | |
680 | ||
681 | --children:: | |
682 | ||
683 | Print also the children of the commit (in the form "commit child..."). | |
684 | Also enables parent rewriting, see 'History Simplification' below. | |
685 | ||
686 | ifdef::git-rev-list[] | |
687 | --timestamp:: | |
688 | Print the raw commit timestamp. | |
689 | endif::git-rev-list[] | |
690 | ||
691 | --left-right:: | |
692 | ||
693 | Mark which side of a symmetric diff a commit is reachable from. | |
694 | Commits from the left side are prefixed with `<` and those from | |
695 | the right with `>`. If combined with `--boundary`, those | |
696 | commits are prefixed with `-`. | |
697 | + | |
698 | For example, if you have this topology: | |
699 | + | |
700 | ----------------------------------------------------------------------- | |
701 | y---b---b branch B | |
702 | / \ / | |
703 | / . | |
704 | / / \ | |
705 | o---x---a---a branch A | |
706 | ----------------------------------------------------------------------- | |
707 | + | |
708 | you would get an output like this: | |
709 | + | |
710 | ----------------------------------------------------------------------- | |
711 | $ git rev-list --left-right --boundary --pretty=oneline A...B | |
712 | ||
713 | >bbbbbbb... 3rd on b | |
714 | >bbbbbbb... 2nd on b | |
715 | <aaaaaaa... 3rd on a | |
716 | <aaaaaaa... 2nd on a | |
717 | -yyyyyyy... 1st on b | |
718 | -xxxxxxx... 1st on a | |
719 | ----------------------------------------------------------------------- | |
720 | ||
721 | --graph:: | |
722 | ||
723 | Draw a text-based graphical representation of the commit history | |
724 | on the left hand side of the output. This may cause extra lines | |
725 | to be printed in between commits, in order for the graph history | |
726 | to be drawn properly. | |
727 | + | |
728 | This enables parent rewriting, see 'History Simplification' below. | |
729 | + | |
730 | This implies the '--topo-order' option by default, but the | |
731 | '--date-order' option may also be specified. | |
732 | ||
733 | ifdef::git-rev-list[] | |
734 | --count:: | |
735 | Print a number stating how many commits would have been | |
736 | listed, and suppress all other output. When used together | |
737 | with '--left-right', instead print the counts for left and | |
b388e14b MG |
738 | right commits, separated by a tab. When used together with |
739 | '--cherry-mark', omit patch equivalent commits from these | |
740 | counts and print the count for equivalent commits separated | |
741 | by a tab. | |
f98fd436 MG |
742 | endif::git-rev-list[] |
743 | ||
744 | ||
745 | ifndef::git-rev-list[] | |
746 | Diff Formatting | |
747 | ~~~~~~~~~~~~~~~ | |
748 | ||
749 | Below are listed options that control the formatting of diff output. | |
750 | Some of them are specific to linkgit:git-rev-list[1], however other diff | |
751 | options may be given. See linkgit:git-diff-files[1] for more options. | |
752 | ||
753 | -c:: | |
754 | ||
755 | With this option, diff output for a merge commit | |
756 | shows the differences from each of the parents to the merge result | |
757 | simultaneously instead of showing pairwise diff between a parent | |
758 | and the result one at a time. Furthermore, it lists only files | |
759 | which were modified from all parents. | |
760 | ||
761 | --cc:: | |
762 | ||
edfbbf7e | 763 | This flag implies the '-c' option and further compresses the |
f98fd436 MG |
764 | patch output by omitting uninteresting hunks whose contents in |
765 | the parents have only two variants and the merge result picks | |
766 | one of them without modification. | |
767 | ||
768 | -m:: | |
769 | ||
770 | This flag makes the merge commits show the full diff like | |
771 | regular commits; for each merge parent, a separate log entry | |
772 | and diff is generated. An exception is that only diff against | |
773 | the first parent is shown when '--first-parent' option is given; | |
774 | in that case, the output represents the changes the merge | |
775 | brought _into_ the then-current branch. | |
776 | ||
777 | -r:: | |
778 | ||
779 | Show recursive diffs. | |
780 | ||
781 | -t:: | |
782 | ||
783 | Show the tree objects in the diff output. This implies '-r'. | |
784 | ||
785 | -s:: | |
786 | Suppress diff output. | |
787 | endif::git-rev-list[] |