Skip to content

Commit e4f3761

Browse files
committed
Merge branch 'pb/log-rev-list-doc' into jch
"git help log" has been enhanced by sharing more material from the documentation for the underlying "git rev-list" command. * pb/log-rev-list-doc: git-log.txt: include rev-list-description.txt git-rev-list.txt: move description to separate file git-rev-list.txt: tweak wording in set operations git-rev-list.txt: fix Asciidoc syntax revisions.txt: describe 'rev1 rev2 ...' meaning for ranges git-log.txt: add links to 'rev-list' and 'diff' docs
2 parents e21b753 + bea8665 commit e4f3761

File tree

4 files changed

+71
-40
lines changed

4 files changed

+71
-40
lines changed

Documentation/git-log.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ DESCRIPTION
1515
-----------
1616
Shows the commit logs.
1717

18-
The command takes options applicable to the `git rev-list`
18+
:git-log: 1
19+
include::rev-list-description.txt[]
20+
21+
The command takes options applicable to the linkgit:git-rev-list[1]
1922
command to control what is shown and how, and options applicable to
20-
the `git diff-*` commands to control how the changes
23+
the linkgit:git-diff[1] command to control how the changes
2124
each commit introduces are shown.
2225

2326

Documentation/git-rev-list.txt

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,8 @@ SYNOPSIS
1414
DESCRIPTION
1515
-----------
1616

17-
List commits that are reachable by following the `parent` links from the
18-
given commit(s), but exclude commits that are reachable from the one(s)
19-
given with a '{caret}' in front of them. The output is given in reverse
20-
chronological order by default.
21-
22-
You can think of this as a set operation. Commits given on the command
23-
line form a set of commits that are reachable from any of them, and then
24-
commits reachable from any of the ones given with '{caret}' in front are
25-
subtracted from that set. The remaining commits are what comes out in the
26-
command's output. Various other options and paths parameters can be used
27-
to further limit the result.
28-
29-
Thus, the following command:
30-
31-
-----------------------------------------------------------------------
32-
$ git rev-list foo bar ^baz
33-
-----------------------------------------------------------------------
34-
35-
means "list all the commits which are reachable from 'foo' or 'bar', but
36-
not from 'baz'".
37-
38-
A special notation "'<commit1>'..'<commit2>'" can be used as a
39-
short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
40-
the following may be used interchangeably:
41-
42-
-----------------------------------------------------------------------
43-
$ git rev-list origin..HEAD
44-
$ git rev-list HEAD ^origin
45-
-----------------------------------------------------------------------
46-
47-
Another special notation is "'<commit1>'...'<commit2>'" which is useful
48-
for merges. The resulting set of commits is the symmetric difference
49-
between the two operands. The following two commands are equivalent:
50-
51-
-----------------------------------------------------------------------
52-
$ git rev-list A B --not $(git merge-base --all A B)
53-
$ git rev-list A...B
54-
-----------------------------------------------------------------------
17+
:git-rev-list: 1
18+
include::rev-list-description.txt[]
5519

5620
'rev-list' is a very essential Git command, since it
5721
provides the ability to build and traverse commit ancestry graphs. For
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
List commits that are reachable by following the `parent` links from the
2+
given commit(s), but exclude commits that are reachable from the one(s)
3+
given with a '{caret}' in front of them. The output is given in reverse
4+
chronological order by default.
5+
6+
You can think of this as a set operation. Commits reachable from any of
7+
the commits given on the command line form a set, and then commits reachable
8+
from any of the ones given with '{caret}' in front are subtracted from that
9+
set. The remaining commits are what comes out in the command's output.
10+
Various other options and paths parameters can be used to further limit the
11+
result.
12+
13+
Thus, the following command:
14+
15+
ifdef::git-rev-list[]
16+
-----------------------------------------------------------------------
17+
$ git rev-list foo bar ^baz
18+
-----------------------------------------------------------------------
19+
endif::git-rev-list[]
20+
ifdef::git-log[]
21+
-----------------------------------------------------------------------
22+
$ git log foo bar ^baz
23+
-----------------------------------------------------------------------
24+
endif::git-log[]
25+
26+
means "list all the commits which are reachable from 'foo' or 'bar', but
27+
not from 'baz'".
28+
29+
A special notation "'<commit1>'..'<commit2>'" can be used as a
30+
short-hand for "^'<commit1>' '<commit2>'". For example, either of
31+
the following may be used interchangeably:
32+
33+
ifdef::git-rev-list[]
34+
-----------------------------------------------------------------------
35+
$ git rev-list origin..HEAD
36+
$ git rev-list HEAD ^origin
37+
-----------------------------------------------------------------------
38+
endif::git-rev-list[]
39+
ifdef::git-log[]
40+
-----------------------------------------------------------------------
41+
$ git log origin..HEAD
42+
$ git log HEAD ^origin
43+
-----------------------------------------------------------------------
44+
endif::git-log[]
45+
46+
Another special notation is "'<commit1>'...'<commit2>'" which is useful
47+
for merges. The resulting set of commits is the symmetric difference
48+
between the two operands. The following two commands are equivalent:
49+
50+
ifdef::git-rev-list[]
51+
-----------------------------------------------------------------------
52+
$ git rev-list A B --not $(git merge-base --all A B)
53+
$ git rev-list A...B
54+
-----------------------------------------------------------------------
55+
endif::git-rev-list[]
56+
ifdef::git-log[]
57+
-----------------------------------------------------------------------
58+
$ git log A B --not $(git merge-base --all A B)
59+
$ git log A...B
60+
-----------------------------------------------------------------------
61+
endif::git-log[]

Documentation/revisions.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ specifying a single revision, using the notation described in the
254254
previous section, means the set of commits `reachable` from the given
255255
commit.
256256

257+
Specifying several revisions means the set of commits reachable from
258+
any of the given commits.
259+
257260
A commit's reachable set is the commit itself and the commits in
258261
its ancestry chain.
259262

0 commit comments

Comments
 (0)