Merge with master.kernel.org:/pub/scm/git/git.git
[git.git] / Documentation / git-rev-list.txt
1 git-rev-list(1)
2 ===============
3 v0.1, May 2005
4
5 NAME
6 ----
7 git-rev-list - Lists commit objects in reverse chronological order
8
9
10 SYNOPSIS
11 --------
12 'git-rev-list' [ *--max-count*=number ] [ *--max-age*=timestamp ] [ *--min-age*=timestamp ] [ *--bisect* ] [ *--pretty* ] [ *--objects* ] [ *--merge-order* [ *--show-breaks* ] ] <commit> [ <commit> ...] [ ^<commit> ...]
13
14 DESCRIPTION
15 -----------
16 Lists commit objects in reverse chronological order starting at the
17 given commit(s), taking ancestry relationship into account.  This is
18 useful to produce human-readable log output.
19
20 Commits which are stated with a preceding '^' cause listing to stop at
21 that point. Their parents are implied. "git-rev-list foo bar ^baz" thus
22 means "list all the commits which are included in 'foo' and 'bar', but
23 not in 'baz'".
24
25 OPTIONS
26 -------
27 --pretty::
28         Print the contents of the commit changesets in human-readable form.
29
30 --objects::
31         Print the object IDs of any object referenced by the listed commits.
32         'git-rev-list --objects foo ^bar' thus means "send me all object IDs
33         which I need to download if I have the commit object 'bar', but
34         not 'foo'".
35
36 --bisect::
37         Limit output to the one commit object which is roughly halfway
38         between the included and excluded commits. Thus, if 'git-rev-list
39         --bisect foo ^bar ^baz' outputs 'midpoint', the output
40         of 'git-rev-list foo ^midpoint' and 'git-rev-list midpoint
41         ^bar ^baz' would be of roughly the same length. Finding the change
42         which introduces a regression is thus reduced to a binary search:
43         repeatedly generate and test new 'midpoint's until the commit chain
44         is of length one.
45
46 --merge-order::
47         When specified the commit history is decomposed into a unique
48         sequence of minimal, non-linear epochs and maximal, linear epochs.
49         Non-linear epochs are then linearised by sorting them into merge
50         order, which is described below.
51 +
52 Maximal, linear epochs correspond to periods of sequential development.
53 Minimal, non-linear epochs correspond to periods of divergent development
54 followed by a converging merge. The theory of epochs is described in more
55 detail at
56 link:http://blackcubes.dyndns.org/epoch/[http://blackcubes.dyndns.org/epoch/].
57 +
58 The merge order for a non-linear epoch is defined as a linearisation for which
59 the following invariants are true:
60 +
61     1. if a commit P is reachable from commit N, commit P sorts after commit N
62        in the linearised list.
63     2. if Pi and Pj are any two parents of a merge M (with i < j), then any
64        commit N, such that N is reachable from Pj but not reachable from Pi,
65        sorts before all commits reachable from Pi.
66 +
67 Invariant 1 states that later commits appear before earlier commits they are
68 derived from.
69 +
70 Invariant 2 states that commits unique to "later" parents in a merge, appear
71 before all commits from "earlier" parents of a merge.
72
73 --show-breaks::
74         Each item of the list is output with a 2-character prefix consisting
75         of one of: (|), (^), (=) followed by a space.
76 +
77 Commits marked with (=) represent the boundaries of minimal, non-linear epochs
78 and correspond either to the start of a period of divergent development or to
79 the end of such a period.
80 +
81 Commits marked with (|) are direct parents of commits immediately preceding
82 the marked commit in the list.
83 +
84 Commits marked with (^) are not parents of the immediately preceding commit.
85 These "breaks" represent necessary discontinuities implied by trying to
86 represent an arbtirary DAG in a linear form.
87 +
88 *--show-breaks* is only valid if *--merge-order* is also specified.
89
90 Author
91 ------
92 Written by Linus Torvalds <torvalds@osdl.org>
93
94 Original *--merge-order* logic by Jon Seymour <jon.seymour@gmail.com>
95
96 Documentation
97 --------------
98 Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org>.
99
100 GIT
101 ---
102 Part of the gitlink:git[7] suite
103