git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 3/4] git-log.txt: include rev-list-description.txt

From
Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 3, 2020, 03:38 UTC
Message-ID
<eeaf4fe5dc51ba651c85c6dd70919cc1126b8a30.1593747509.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.590.v2.git.1593747509.gitgitgadget@gmail.com>
From: Philippe Blain <levraiphilippeblain@gmail.com>

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>
---
 Documentation/git-log.txt              |  3 +++
 Documentation/git-rev-list.txt         |  1 +
 Documentation/rev-list-description.txt | 23 +++++++++++++++++++++++
 3 files changed, 27 insertions(+)
diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 04ea18d1c0..d34d101255 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -15,6 +15,9 @@ DESCRIPTION
 -----------
 Shows the commit logs.
 
+:git-log: 1
+include::rev-list-description.txt[]
+
 The command takes options applicable to the linkgit:git-rev-list[1]
 command to control what is shown and how, and options applicable to
 the linkgit:git-diff[1] family of commands to control how the changes
diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index b06e11ae56..5da66232dc 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -14,6 +14,7 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
+:git-rev-list: 1
 include::rev-list-description.txt[]
 
 'rev-list' is a very essential Git command, since it
diff --git a/Documentation/rev-list-description.txt b/Documentation/rev-list-description.txt
index aa6bbd8cec..dce78561be 100644
--- a/Documentation/rev-list-description.txt
+++ b/Documentation/rev-list-description.txt
@@ -12,9 +12,16 @@ to further limit the result.
 
 Thus, the following command:
 
+ifdef::git-rev-list[]
 -----------------------------------------------------------------------
 	$ git rev-list foo bar ^baz
 -----------------------------------------------------------------------
+endif::git-rev-list[]
+ifdef::git-log[]
+-----------------------------------------------------------------------
+	$ git log foo bar ^baz
+-----------------------------------------------------------------------
+endif::git-log[]
 
 means "list all the commits which are reachable from 'foo' or 'bar', but
 not from 'baz'".
@@ -23,16 +30,32 @@ A special notation "'<commit1>'..'<commit2>'" can be used as a
 short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
 the following may be used interchangeably:
 
+ifdef::git-rev-list[]
 -----------------------------------------------------------------------
 	$ git rev-list origin..HEAD
 	$ git rev-list HEAD ^origin
 -----------------------------------------------------------------------
+endif::git-rev-list[]
+ifdef::git-log[]
+-----------------------------------------------------------------------
+	$ git log origin..HEAD
+	$ git log HEAD ^origin
+-----------------------------------------------------------------------
+endif::git-log[]
 
 Another special notation is "'<commit1>'...'<commit2>'" which is useful
 for merges.  The resulting set of commits is the symmetric difference
 between the two operands.  The following two commands are equivalent:
 
+ifdef::git-rev-list[]
 -----------------------------------------------------------------------
 	$ git rev-list A B --not $(git merge-base --all A B)
 	$ git rev-list A...B
 -----------------------------------------------------------------------
+endif::git-rev-list[]
+ifdef::git-log[]
+-----------------------------------------------------------------------
+	$ git log A B --not $(git merge-base --all A B)
+	$ git log A...B
+-----------------------------------------------------------------------
+endif::git-log[]
-- 
gitgitgadget
Previous: Philippe BlainNext: Philippe Blain via GitGitGadget
Message 12 of 23 in “doc: log takes multiple revision ranges”
  1. doc: log takes multiple revision rangesPhilippe Blain via GitGitGadget, Mar 28, 2020
  2. Junio C HamanoMar 29, 2020
  3. Philippe BlainMar 30, 2020
  4. Junio C HamanoMar 30, 2020
  5. Philip OakleyJul 5, 2020
  6. Philippe BlainJul 7, 2020
  7. Taylor BlauMar 31, 2020
  8. 0/4 doc: include git rev-list description in git log docPhilippe Blain via GitGitGadget, Jul 3, 2020
  9. 1/4 git-log.txt: add links to 'rev-list' and 'diff' docsPhilippe Blain via GitGitGadget, Jul 3, 2020
  10. Junio C HamanoJul 7, 2020
  11. Philippe BlainJul 7, 2020
  12. 3/4 git-log.txt: include rev-list-description.txtPhilippe Blain via GitGitGadget, Jul 3, 2020
  13. 2/4 git-rev-list.txt: move description to separate filePhilippe Blain via GitGitGadget, Jul 3, 2020
  14. 4/4 rev-list-description.txt: fix Asciidoc syntaxPhilippe Blain via GitGitGadget, Jul 3, 2020
  15. Junio C HamanoJul 7, 2020
  16. Philippe BlainJul 7, 2020
  17. 0/6 doc: include git rev-list description in git log docPhilippe Blain via GitGitGadget, Jul 9, 2020
  18. 1/6 git-log.txt: add links to 'rev-list' and 'diff' docsPhilippe Blain via GitGitGadget, Jul 9, 2020
  19. 4/6 git-rev-list.txt: tweak wording in set operationsPhilippe Blain via GitGitGadget, Jul 9, 2020
  20. 2/6 revisions.txt: describe 'rev1 rev2 ...' meaning for rangesPhilippe Blain via GitGitGadget, Jul 9, 2020
  21. 3/6 git-rev-list.txt: fix Asciidoc syntaxPhilippe Blain via GitGitGadget, Jul 9, 2020
  22. 5/6 git-rev-list.txt: move description to separate filePhilippe Blain via GitGitGadget, Jul 9, 2020
  23. 6/6 git-log.txt: include rev-list-description.txtPhilippe Blain via GitGitGadget, Jul 9, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.