Skip to content

Commit bea8665

Browse files
phil-blaingitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6be6b17 commit bea8665

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Documentation/git-log.txt

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

18+
:git-log: 1
19+
include::rev-list-description.txt[]
20+
1821
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
2023
the linkgit:git-diff[1] command to control how the changes

Documentation/git-rev-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ SYNOPSIS
1414
DESCRIPTION
1515
-----------
1616

17+
:git-rev-list: 1
1718
include::rev-list-description.txt[]
1819

1920
'rev-list' is a very essential Git command, since it

Documentation/rev-list-description.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,16 @@ result.
1212

1313
Thus, the following command:
1414

15+
ifdef::git-rev-list[]
1516
-----------------------------------------------------------------------
1617
$ git rev-list foo bar ^baz
1718
-----------------------------------------------------------------------
19+
endif::git-rev-list[]
20+
ifdef::git-log[]
21+
-----------------------------------------------------------------------
22+
$ git log foo bar ^baz
23+
-----------------------------------------------------------------------
24+
endif::git-log[]
1825

1926
means "list all the commits which are reachable from 'foo' or 'bar', but
2027
not from 'baz'".
@@ -23,16 +30,32 @@ A special notation "'<commit1>'..'<commit2>'" can be used as a
2330
short-hand for "^'<commit1>' '<commit2>'". For example, either of
2431
the following may be used interchangeably:
2532

33+
ifdef::git-rev-list[]
2634
-----------------------------------------------------------------------
2735
$ git rev-list origin..HEAD
2836
$ git rev-list HEAD ^origin
2937
-----------------------------------------------------------------------
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[]
3045

3146
Another special notation is "'<commit1>'...'<commit2>'" which is useful
3247
for merges. The resulting set of commits is the symmetric difference
3348
between the two operands. The following two commands are equivalent:
3449

50+
ifdef::git-rev-list[]
3551
-----------------------------------------------------------------------
3652
$ git rev-list A B --not $(git merge-base --all A B)
3753
$ git rev-list A...B
3854
-----------------------------------------------------------------------
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[]

0 commit comments

Comments
 (0)