setup_revisions(): handle -n<n> and -<n> internally.
[git.git] / Documentation / git-rev-list.txt
1 git-rev-list(1)
2 ===============
3
4 NAME
5 ----
6 git-rev-list - Lists commit objects in reverse chronological order
7
8
9 SYNOPSIS
10 --------
11 [verse]
12 'git-rev-list' [ \--max-count=number ]
13              [ \--max-age=timestamp ]
14              [ \--min-age=timestamp ]
15              [ \--sparse ]
16              [ \--no-merges ]
17              [ \--remove-empty ]
18              [ \--all ]
19              [ \--topo-order ]
20              [ \--parents ]
21              [ \--objects [ \--unpacked ] ]
22              [ \--pretty | \--header ]
23              [ \--bisect ]
24              <commit>... [ \-- <paths>... ]
25
26 DESCRIPTION
27 -----------
28 Lists commit objects in reverse chronological order starting at the
29 given commit(s), taking ancestry relationship into account.  This is
30 useful to produce human-readable log output.
31
32 Commits which are stated with a preceding '{caret}' cause listing to stop at
33 that point. Their parents are implied. "git-rev-list foo bar {caret}baz" thus
34 means "list all the commits which are included in 'foo' and 'bar', but
35 not in 'baz'".
36
37 A special notation <commit1>..<commit2> can be used as a
38 short-hand for {caret}<commit1> <commit2>.
39
40
41 OPTIONS
42 -------
43 --pretty::
44         Print the contents of the commit changesets in human-readable form.
45
46 --header::
47         Print the contents of the commit in raw-format; each
48         record is separated with a NUL character.
49
50 --objects::
51         Print the object IDs of any object referenced by the listed commits.
52         'git-rev-list --objects foo ^bar' thus means "send me all object IDs
53         which I need to download if I have the commit object 'bar', but
54         not 'foo'".
55
56 --unpacked::
57         Only useful with `--objects`; print the object IDs that
58         are not in packs.
59
60 --bisect::
61         Limit output to the one commit object which is roughly halfway
62         between the included and excluded commits. Thus, if 'git-rev-list
63         --bisect foo ^bar ^baz' outputs 'midpoint', the output
64         of 'git-rev-list foo ^midpoint' and 'git-rev-list midpoint
65         ^bar ^baz' would be of roughly the same length. Finding the change
66         which introduces a regression is thus reduced to a binary search:
67         repeatedly generate and test new 'midpoint's until the commit chain
68         is of length one.
69
70 --max-count::
71         Limit the number of commits output.
72
73 --max-age=timestamp, --min-age=timestamp::
74         Limit the commits output to specified time range.
75
76 --sparse::
77         When optional paths are given, the command outputs only
78         the commits that changes at least one of them, and also
79         ignores merges that do not touch the given paths.  This
80         flag makes the command output all eligible commits
81         (still subject to count and age limitation), but apply
82         merge simplification nevertheless.
83
84 --remove-empty::
85         Stop when a given path disappears from the tree.
86
87 --all::
88         Pretend as if all the refs in `$GIT_DIR/refs/` are
89         listed on the command line as <commit>.
90
91 --topo-order::
92         By default, the commits are shown in reverse
93         chronological order.  This option makes them appear in
94         topological order (i.e. descendant commits are shown
95         before their parents).
96
97 Author
98 ------
99 Written by Linus Torvalds <torvalds@osdl.org>
100
101 Documentation
102 --------------
103 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
104
105 GIT
106 ---
107 Part of the gitlink:git[7] suite
108