git-log.txt: include rev-list-description.txt
The `git log` synopsis mentions `<revision range>`, and the description of this option links to gitrevisions(7), but a nice explanation of how a revision range can be constructed from individual commits, optionnally prefixed with `^`, also exists in `rev-list-description.txt`. Include this description in the man page for `git log`. Add Asciidoc 'ifdef's to `rev-list-description.txt` so that either `git rev-list` or `git log` appears in the respective man pages. Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Philippe Blain committed
Jul 9, 2020 at 02:16 UTC
bea866587c7639fac4146cadfdee30fcc9815c36
3 files changed
+27
Documentation/git-log.txt
+3
@@ -15,6 +15,9 @@ DESCRIPTION
15
-----------
16
Shows the commit logs.
17
18
+:git-log: 1
19
+include::rev-list-description.txt[]
20
+
21
The command takes options applicable to the linkgit:git-rev-list[1]
22
command to control what is shown and how, and options applicable to
23
the linkgit:git-diff[1] command to control how the changes
Documentation/git-rev-list.txt
+1
@@ -14,6 +14,7 @@ SYNOPSIS
14
DESCRIPTION
15
-----------
16
17
+:git-rev-list: 1
18
include::rev-list-description.txt[]
19
20
'rev-list' is a very essential Git command, since it
Documentation/rev-list-description.txt
+23
@@ -12,9 +12,16 @@ 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'".
@@ -23,16 +30,32 @@ 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[]