]> git.ipfire.org Git - thirdparty/git.git/blame - Documentation/git-rev-list.txt
rev-list: stop when the file disappears
[thirdparty/git.git] / Documentation / git-rev-list.txt
CommitLineData
2cf565c5
DG
1git-rev-list(1)
2===============
2cf565c5
DG
3
4NAME
5----
6git-rev-list - Lists commit objects in reverse chronological order
7
8
9SYNOPSIS
10--------
353ce815 11[verse]
69e0c256 12'git-rev-list' [ \--max-count=number ]
353ce815
JF
13 [ \--max-age=timestamp ]
14 [ \--min-age=timestamp ]
15 [ \--sparse ]
16 [ \--no-merges ]
17 [ \--all ]
18 [ [ \--merge-order [ \--show-breaks ] ] | [ \--topo-order ] ]
19 [ \--parents ]
20 [ \--objects [ \--unpacked ] ]
21 [ \--pretty | \--header ]
22 [ \--bisect ]
23 <commit>... [ \-- <paths>... ]
2cf565c5
DG
24
25DESCRIPTION
26-----------
27Lists commit objects in reverse chronological order starting at the
adcd3512 28given commit(s), taking ancestry relationship into account. This is
2cf565c5
DG
29useful to produce human-readable log output.
30
69e0c256
JH
31Commits which are stated with a preceding '{caret}' cause listing to stop at
32that point. Their parents are implied. "git-rev-list foo bar {caret}baz" thus
adcd3512
MU
33means "list all the commits which are included in 'foo' and 'bar', but
34not in 'baz'".
35
69e0c256
JH
36A special notation <commit1>..<commit2> can be used as a
37short-hand for {caret}<commit1> <commit2>.
38
39
df8baa42
JF
40OPTIONS
41-------
42--pretty::
43 Print the contents of the commit changesets in human-readable form.
44
69e0c256
JH
45--header::
46 Print the contents of the commit in raw-format; each
47 record is separated with a NUL character.
48
df8baa42
JF
49--objects::
50 Print the object IDs of any object referenced by the listed commits.
51 'git-rev-list --objects foo ^bar' thus means "send me all object IDs
52 which I need to download if I have the commit object 'bar', but
53 not 'foo'".
54
69e0c256
JH
55--unpacked::
56 Only useful with `--objects`; print the object IDs that
57 are not in packs.
58
df8baa42
JF
59--bisect::
60 Limit output to the one commit object which is roughly halfway
61 between the included and excluded commits. Thus, if 'git-rev-list
62 --bisect foo ^bar ^baz' outputs 'midpoint', the output
63 of 'git-rev-list foo ^midpoint' and 'git-rev-list midpoint
64 ^bar ^baz' would be of roughly the same length. Finding the change
65 which introduces a regression is thus reduced to a binary search:
66 repeatedly generate and test new 'midpoint's until the commit chain
67 is of length one.
68
69e0c256
JH
69--max-count::
70 Limit the number of commits output.
71
72--max-age=timestamp, --min-age=timestamp::
73 Limit the commits output to specified time range.
74
75--sparse::
76 When optional paths are given, the command outputs only
64b1f6e6
JH
77 the commits that changes at least one of them, and also
78 ignores merges that do not touch the given paths. This
79 flag makes the command output all eligible commits
80 (still subject to count and age limitation), but apply
81 merge simplification nevertheless.
69e0c256
JH
82
83--all::
84 Pretend as if all the refs in `$GIT_DIR/refs/` are
85 listed on the command line as <commit>.
86
87--topo-order::
88 By default, the commits are shown in reverse
89 chronological order. This option makes them appear in
90 topological order (i.e. descendant commits are shown
91 before their parents).
92
df8baa42
JF
93--merge-order::
94 When specified the commit history is decomposed into a unique
95 sequence of minimal, non-linear epochs and maximal, linear epochs.
96 Non-linear epochs are then linearised by sorting them into merge
97 order, which is described below.
98+
17ebe977
PB
99Maximal, linear epochs correspond to periods of sequential development.
100Minimal, non-linear epochs correspond to periods of divergent development
101followed by a converging merge. The theory of epochs is described in more
102detail at
103link:http://blackcubes.dyndns.org/epoch/[http://blackcubes.dyndns.org/epoch/].
df8baa42 104+
17ebe977
PB
105The merge order for a non-linear epoch is defined as a linearisation for which
106the following invariants are true:
df8baa42 107+
17ebe977
PB
108 1. if a commit P is reachable from commit N, commit P sorts after commit N
109 in the linearised list.
110 2. if Pi and Pj are any two parents of a merge M (with i < j), then any
111 commit N, such that N is reachable from Pj but not reachable from Pi,
112 sorts before all commits reachable from Pi.
df8baa42 113+
17ebe977
PB
114Invariant 1 states that later commits appear before earlier commits they are
115derived from.
df8baa42 116+
17ebe977
PB
117Invariant 2 states that commits unique to "later" parents in a merge, appear
118before all commits from "earlier" parents of a merge.
119
df8baa42
JF
120--show-breaks::
121 Each item of the list is output with a 2-character prefix consisting
122 of one of: (|), (^), (=) followed by a space.
123+
17ebe977
PB
124Commits marked with (=) represent the boundaries of minimal, non-linear epochs
125and correspond either to the start of a period of divergent development or to
126the end of such a period.
df8baa42 127+
17ebe977
PB
128Commits marked with (|) are direct parents of commits immediately preceding
129the marked commit in the list.
df8baa42 130+
17ebe977
PB
131Commits marked with (^) are not parents of the immediately preceding commit.
132These "breaks" represent necessary discontinuities implied by trying to
89438677 133represent an arbitrary DAG in a linear form.
df8baa42 134+
69e0c256
JH
135`--show-breaks` is only valid if `--merge-order` is also specified.
136
2cf565c5
DG
137
138Author
139------
140Written by Linus Torvalds <torvalds@osdl.org>
141
a3437b8c
JS
142Original *--merge-order* logic by Jon Seymour <jon.seymour@gmail.com>
143
2cf565c5
DG
144Documentation
145--------------
146Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
147
148GIT
149---
a7154e91 150Part of the gitlink:git[7] suite
2cf565c5 151