]>
Commit | Line | Data |
---|---|---|
2cf565c5 DG |
1 | git-rev-list(1) |
2 | =============== | |
2cf565c5 DG |
3 | |
4 | NAME | |
5 | ---- | |
6 | git-rev-list - Lists commit objects in reverse chronological order | |
7 | ||
8 | ||
9 | SYNOPSIS | |
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 ] | |
93b74bca | 17 | [ \--remove-empty ] |
0d2c9d67 | 18 | [ \--not ] |
353ce815 | 19 | [ \--all ] |
765ac8ec | 20 | [ \--topo-order ] |
353ce815 | 21 | [ \--parents ] |
ec579767 | 22 | [ [\--objects | \--objects-edge] [ \--unpacked ] ] |
353ce815 JF |
23 | [ \--pretty | \--header ] |
24 | [ \--bisect ] | |
25 | <commit>... [ \-- <paths>... ] | |
2cf565c5 DG |
26 | |
27 | DESCRIPTION | |
28 | ----------- | |
29 | Lists commit objects in reverse chronological order starting at the | |
adcd3512 | 30 | given commit(s), taking ancestry relationship into account. This is |
2cf565c5 DG |
31 | useful to produce human-readable log output. |
32 | ||
69e0c256 JH |
33 | Commits which are stated with a preceding '{caret}' cause listing to stop at |
34 | that point. Their parents are implied. "git-rev-list foo bar {caret}baz" thus | |
adcd3512 MU |
35 | means "list all the commits which are included in 'foo' and 'bar', but |
36 | not in 'baz'". | |
37 | ||
69e0c256 JH |
38 | A special notation <commit1>..<commit2> can be used as a |
39 | short-hand for {caret}<commit1> <commit2>. | |
40 | ||
0d2c9d67 RS |
41 | Another special notation is <commit1>...<commit2> which is useful for |
42 | merges. The resulting set of commits is the symmetric difference | |
43 | between the two operands. The following two commands are equivalent: | |
44 | ||
45 | ------------ | |
46 | $ git-rev-list A B --not $(git-merge-base --all A B) | |
47 | $ git-rev-list A...B | |
48 | ------------ | |
69e0c256 | 49 | |
df8baa42 JF |
50 | OPTIONS |
51 | ------- | |
52 | --pretty:: | |
53 | Print the contents of the commit changesets in human-readable form. | |
54 | ||
69e0c256 JH |
55 | --header:: |
56 | Print the contents of the commit in raw-format; each | |
57 | record is separated with a NUL character. | |
58 | ||
f443455a ML |
59 | --parents:: |
60 | Print the parents of the commit. | |
61 | ||
df8baa42 JF |
62 | --objects:: |
63 | Print the object IDs of any object referenced by the listed commits. | |
64 | 'git-rev-list --objects foo ^bar' thus means "send me all object IDs | |
65 | which I need to download if I have the commit object 'bar', but | |
66 | not 'foo'". | |
67 | ||
ec579767 JH |
68 | --objects-edge:: |
69 | Similar to `--objects`, but also print the IDs of | |
addf88e4 | 70 | excluded commits prefixed with a `-` character. This is |
ec579767 JH |
71 | used by `git-pack-objects` to build 'thin' pack, which |
72 | records objects in deltified form based on objects | |
73 | contained in these excluded commits to reduce network | |
74 | traffic. | |
75 | ||
69e0c256 JH |
76 | --unpacked:: |
77 | Only useful with `--objects`; print the object IDs that | |
78 | are not in packs. | |
79 | ||
df8baa42 JF |
80 | --bisect:: |
81 | Limit output to the one commit object which is roughly halfway | |
82 | between the included and excluded commits. Thus, if 'git-rev-list | |
afb4ff20 JH |
83 | --bisect foo {caret}bar {caret}baz' outputs 'midpoint', the output |
84 | of 'git-rev-list foo {caret}midpoint' and 'git-rev-list midpoint | |
85 | {caret}bar {caret}baz' would be of roughly the same length. | |
86 | Finding the change | |
df8baa42 JF |
87 | which introduces a regression is thus reduced to a binary search: |
88 | repeatedly generate and test new 'midpoint's until the commit chain | |
89 | is of length one. | |
90 | ||
69e0c256 JH |
91 | --max-count:: |
92 | Limit the number of commits output. | |
93 | ||
94 | --max-age=timestamp, --min-age=timestamp:: | |
95 | Limit the commits output to specified time range. | |
96 | ||
97 | --sparse:: | |
98 | When optional paths are given, the command outputs only | |
64b1f6e6 JH |
99 | the commits that changes at least one of them, and also |
100 | ignores merges that do not touch the given paths. This | |
101 | flag makes the command output all eligible commits | |
102 | (still subject to count and age limitation), but apply | |
103 | merge simplification nevertheless. | |
69e0c256 | 104 | |
93b74bca JH |
105 | --remove-empty:: |
106 | Stop when a given path disappears from the tree. | |
107 | ||
f443455a ML |
108 | --no-merges:: |
109 | Do not print commits with more than one parent. | |
110 | ||
0d2c9d67 RS |
111 | --not:: |
112 | Reverses the meaning of the '{caret}' prefix (or lack | |
113 | thereof) for all following revision specifiers, up to | |
114 | the next `--not`. | |
115 | ||
69e0c256 JH |
116 | --all:: |
117 | Pretend as if all the refs in `$GIT_DIR/refs/` are | |
118 | listed on the command line as <commit>. | |
119 | ||
120 | --topo-order:: | |
121 | By default, the commits are shown in reverse | |
122 | chronological order. This option makes them appear in | |
123 | topological order (i.e. descendant commits are shown | |
124 | before their parents). | |
125 | ||
2cf565c5 DG |
126 | Author |
127 | ------ | |
128 | Written by Linus Torvalds <torvalds@osdl.org> | |
129 | ||
130 | Documentation | |
131 | -------------- | |
132 | Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>. | |
133 | ||
134 | GIT | |
135 | --- | |
a7154e91 | 136 | Part of the gitlink:git[7] suite |
2cf565c5 | 137 |