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