rev-list: documentation and test for --left/right-only
[git/mingw.git] / Documentation / git-rev-list.txt
blob5f47a13d3c6191a0029e7e64603518346b0198ee
1 git-rev-list(1)
2 ===============
4 NAME
5 ----
6 git-rev-list - Lists commit objects in reverse chronological order
9 SYNOPSIS
10 --------
11 [verse]
12 'git rev-list' [ \--max-count=<number> ]
13              [ \--skip=<number> ]
14              [ \--max-age=<timestamp> ]
15              [ \--min-age=<timestamp> ]
16              [ \--sparse ]
17              [ \--merges ]
18              [ \--no-merges ]
19              [ \--first-parent ]
20              [ \--remove-empty ]
21              [ \--full-history ]
22              [ \--not ]
23              [ \--all ]
24              [ \--branches[=<pattern>] ]
25              [ \--tags[=<pattern>] ]
26              [ \--remotes[=<pattern>] ]
27              [ \--glob=<glob-pattern> ]
28              [ \--stdin ]
29              [ \--quiet ]
30              [ \--topo-order ]
31              [ \--parents ]
32              [ \--timestamp ]
33              [ \--left-right ]
34              [ \--left-only ]
35              [ \--right-only ]
36              [ \--cherry-pick ]
37              [ \--encoding[=<encoding>] ]
38              [ \--(author|committer|grep)=<pattern> ]
39              [ \--regexp-ignore-case | -i ]
40              [ \--extended-regexp | -E ]
41              [ \--fixed-strings | -F ]
42              [ \--date=(local|relative|default|iso|rfc|short) ]
43              [ [\--objects | \--objects-edge] [ \--unpacked ] ]
44              [ \--pretty | \--header ]
45              [ \--bisect ]
46              [ \--bisect-vars ]
47              [ \--bisect-all ]
48              [ \--merge ]
49              [ \--reverse ]
50              [ \--walk-reflogs ]
51              [ \--no-walk ] [ \--do-walk ]
52              <commit>... [ \-- <paths>... ]
54 DESCRIPTION
55 -----------
57 List commits that are reachable by following the `parent` links from the
58 given commit(s), but exclude commits that are reachable from the one(s)
59 given with a '{caret}' in front of them.  The output is given in reverse
60 chronological order by default.
62 You can think of this as a set operation.  Commits given on the command
63 line form a set of commits that are reachable from any of them, and then
64 commits reachable from any of the ones given with '{caret}' in front are
65 subtracted from that set.  The remaining commits are what comes out in the
66 command's output.  Various other options and paths parameters can be used
67 to further limit the result.
69 Thus, the following command:
71 -----------------------------------------------------------------------
72         $ git rev-list foo bar ^baz
73 -----------------------------------------------------------------------
75 means "list all the commits which are reachable from 'foo' or 'bar', but
76 not from 'baz'".
78 A special notation "'<commit1>'..'<commit2>'" can be used as a
79 short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
80 the following may be used interchangeably:
82 -----------------------------------------------------------------------
83         $ git rev-list origin..HEAD
84         $ git rev-list HEAD ^origin
85 -----------------------------------------------------------------------
87 Another special notation is "'<commit1>'...'<commit2>'" which is useful
88 for merges.  The resulting set of commits is the symmetric difference
89 between the two operands.  The following two commands are equivalent:
91 -----------------------------------------------------------------------
92         $ git rev-list A B --not $(git merge-base --all A B)
93         $ git rev-list A...B
94 -----------------------------------------------------------------------
96 'rev-list' is a very essential git command, since it
97 provides the ability to build and traverse commit ancestry graphs. For
98 this reason, it has a lot of different options that enables it to be
99 used by commands as different as 'git bisect' and
100 'git repack'.
102 OPTIONS
103 -------
105 :git-rev-list: 1
106 include::rev-list-options.txt[]
108 include::pretty-formats.txt[]
111 Author
112 ------
113 Written by Linus Torvalds <torvalds@osdl.org>
115 Documentation
116 --------------
117 Documentation by David Greaves, Junio C Hamano, Jonas Fonseca
118 and the git-list <git@vger.kernel.org>.
122 Part of the linkgit:git[1] suite