@matheusbsbs / matheus-bagliano / commits / 6be6b171a7
Fork 0

git-rev-list.txt: move description to separate file

A following commit will reuse the description of the `git rev-list` command in the `git log` manpage. Move this description to a separate file. 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 6be6b171a7dc4d901f21b0f24d63147c32ecc008
2 files changed +39 -38
Documentation/git-rev-list.txt
+1 -38
@@ -14,44 +14,7 @@ SYNOPSIS
14 DESCRIPTION
15 -----------
16
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 reachable from any of
23 -the commits given on the command line form a set, and then commits reachable
24 -from any of the ones given with '{caret}' in front are subtracted from that
25 -set. The remaining commits are what comes out in the command's output.
26 -Various other options and paths parameters can be used to further limit the
27 -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 "^'<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 +include::rev-list-description.txt[]
18
19 'rev-list' is a very essential Git command, since it
20 provides the ability to build and traverse commit ancestry graphs. For
Documentation/rev-list-description.txt new
+38
@@ -0,0 +1,38 @@
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 +-----------------------------------------------------------------------
16 +$ git rev-list foo bar ^baz
17 +-----------------------------------------------------------------------
18 +
19 +means "list all the commits which are reachable from 'foo' or 'bar', but
20 +not from 'baz'".
21 +
22 +A special notation "'<commit1>'..'<commit2>'" can be used as a
23 +short-hand for "^'<commit1>' '<commit2>'". For example, either of
24 +the following may be used interchangeably:
25 +
26 +-----------------------------------------------------------------------
27 +$ git rev-list origin..HEAD
28 +$ git rev-list HEAD ^origin
29 +-----------------------------------------------------------------------
30 +
31 +Another special notation is "'<commit1>'...'<commit2>'" which is useful
32 +for merges. The resulting set of commits is the symmetric difference
33 +between the two operands. The following two commands are equivalent:
34 +
35 +-----------------------------------------------------------------------
36 +$ git rev-list A B --not $(git merge-base --all A B)
37 +$ git rev-list A...B
38 +-----------------------------------------------------------------------