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

[PATCH v3 0/6] doc: include git rev-list description in git log doc

From
Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 9, 2020, 02:16 UTC
Message-ID
<pull.590.v3.git.1594261008.gitgitgadget@gmail.com>
In-Reply-To
<pull.590.v2.git.1593747509.gitgitgadget@gmail.com>
Changes since v2:
 * applied Junio's suggestions 
 * added a preparatory commit tweaking the wording of one sentence in the 
   git rev-list description
 * added a new commit adding a sentence in revisions.txt to mention
   explicitly what it means to list several revisions to form a range.

v2: This series moves the nice explanation in the 'Description' section of the git rev-list man page to a separate file and includes this file in the git log man page.

This goal is to make readers more aware that they can write e.g.
git log branch1 branch2 branch3 branch4 --not master

to see commits on each of branch1-4, that are not on master, since this is not immediately obvious (at least to me) in the git log man page.

Note that I made several commits for ease of reviewing, I'll squash some if this would be preferred.

Changes since v1: took a completely different approach following the comments received from Junio and Taylor.

Philippe Blain (6):
  git-log.txt: add links to 'rev-list' and 'diff' docs
  revisions.txt: describe 'rev1 rev2 ...' meaning for ranges
  git-rev-list.txt: fix Asciidoc syntax
  git-rev-list.txt: tweak wording in set operations
  git-rev-list.txt: move description to separate file
  git-log.txt: include rev-list-description.txt
 Documentation/git-log.txt              |  7 ++-
 Documentation/git-rev-list.txt         | 40 +----------------
 Documentation/rev-list-description.txt | 61 ++++++++++++++++++++++++++
 Documentation/revisions.txt            |  3 ++
 4 files changed, 71 insertions(+), 40 deletions(-)
 create mode 100644 Documentation/rev-list-description.txt
base-commit: a08a83db2bf27f015bec9a435f6d73e223c21c5e
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-590%2Fphil-blain%2Fdoc-log-multiple-ranges-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-590/phil-blain/doc-log-multiple-ranges-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/590
Range-diff vs v2:
 1:  59c48282a0 ! 1:  59027b0f6a git-log.txt: add links to 'rev-list' and 'diff' docs
     @@ Documentation/git-log.txt: DESCRIPTION
      +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 `git diff-*` commands to control how the changes
     -+the linkgit:git-diff[1] family of commands to control how the changes
     ++the linkgit:git-diff[1] command to control how the changes
       each commit introduces are shown.
       
       
 -:  ---------- > 2:  3c573695a8 revisions.txt: describe 'rev1 rev2 ...' meaning for ranges
 4:  3b923780c1 ! 3:  b8ee4a743c rev-list-description.txt: fix Asciidoc syntax
     @@ Metadata
      Author: Philippe Blain <levraiphilippeblain@gmail.com>
      
       ## Commit message ##
     -    rev-list-description.txt: fix Asciidoc syntax
     +    git-rev-list.txt: fix Asciidoc syntax
      
          Using '{caret}' inside double quotes and immediately following with a
          single quoted word does not create the desired output: '<commit1>'
     @@ Commit message
      
          Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
      
     - ## Documentation/rev-list-description.txt ##
     -@@ Documentation/rev-list-description.txt: Thus, the following command:
     + ## Documentation/git-rev-list.txt ##
     +@@ Documentation/git-rev-list.txt: to further limit the result.
     + Thus, the following command:
       
     - ifdef::git-rev-list[]
       -----------------------------------------------------------------------
      -	$ git rev-list foo bar ^baz
      +$ git rev-list foo bar ^baz
       -----------------------------------------------------------------------
     - endif::git-rev-list[]
     - ifdef::git-log[]
     - -----------------------------------------------------------------------
     --	$ git log foo bar ^baz
     -+$ git log foo bar ^baz
     - -----------------------------------------------------------------------
     - endif::git-log[]
       
     -@@ Documentation/rev-list-description.txt: means "list all the commits which are reachable from 'foo' or 'bar', but
     + means "list all the commits which are reachable from 'foo' or 'bar', but
       not from 'baz'".
       
       A special notation "'<commit1>'..'<commit2>'" can be used as a
     @@ Documentation/rev-list-description.txt: means "list all the commits which are re
      +short-hand for "^'<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
      +$ 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
     -+$ git log origin..HEAD
     -+$ git log HEAD ^origin
     - -----------------------------------------------------------------------
     - endif::git-log[]
       
     -@@ Documentation/rev-list-description.txt: between the two operands.  The following two commands are equivalent:
     + Another special notation is "'<commit1>'...'<commit2>'" which is useful
     +@@ Documentation/git-rev-list.txt: 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
      +$ 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
     -+$ git log A B --not $(git merge-base --all A B)
     -+$ git log A...B
     - -----------------------------------------------------------------------
     - endif::git-log[]
     + 
     + 'rev-list' is a very essential Git command, since it
 -:  ---------- > 4:  cf934ddf33 git-rev-list.txt: tweak wording in set operations
 2:  daf00d9398 ! 5:  f61bbb57cb git-rev-list.txt: move description to separate file
     @@ Documentation/git-rev-list.txt: SYNOPSIS
      -given with a '{caret}' in front of them.  The output is given in reverse
      -chronological order by default.
      -
     --You can think of this as a set operation.  Commits given on the command
     --line form a set of commits that are reachable from any of them, and then
     --commits reachable from any of the ones given with '{caret}' in front are
     --subtracted from that set.  The remaining commits are what comes out in the
     --command's output.  Various other options and paths parameters can be used
     --to further limit the result.
     +-You can think of this as a set operation. Commits reachable from any of
     +-the commits given on the command line form a set, and then commits reachable
     +-from any of the ones given with '{caret}' in front are subtracted from that
     +-set.  The remaining commits are what comes out in the command's output.
     +-Various other options and paths parameters can be used to further limit the
     +-result.
      -
      -Thus, the following command:
      -
      ------------------------------------------------------------------------
     --	$ git rev-list foo bar ^baz
     +-$ git rev-list foo bar ^baz
      ------------------------------------------------------------------------
      -
      -means "list all the commits which are reachable from 'foo' or 'bar', but
      -not from 'baz'".
      -
      -A special notation "'<commit1>'..'<commit2>'" can be used as a
     --short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
     +-short-hand for "^'<commit1>' '<commit2>'". For example, either of
      -the following may be used interchangeably:
      -
      ------------------------------------------------------------------------
     --	$ git rev-list origin..HEAD
     --	$ git rev-list HEAD ^origin
     +-$ git rev-list origin..HEAD
     +-$ git rev-list HEAD ^origin
      ------------------------------------------------------------------------
      -
      -Another special notation is "'<commit1>'...'<commit2>'" which is useful
     @@ Documentation/git-rev-list.txt: SYNOPSIS
      -between the two operands.  The following two commands are equivalent:
      -
      ------------------------------------------------------------------------
     --	$ git rev-list A B --not $(git merge-base --all A B)
     --	$ git rev-list A...B
     +-$ git rev-list A B --not $(git merge-base --all A B)
     +-$ git rev-list A...B
      ------------------------------------------------------------------------
      +include::rev-list-description.txt[]
       
     @@ Documentation/rev-list-description.txt (new)
      +given with a '{caret}' in front of them.  The output is given in reverse
      +chronological order by default.
      +
     -+You can think of this as a set operation.  Commits given on the command
     -+line form a set of commits that are reachable from any of them, and then
     -+commits reachable from any of the ones given with '{caret}' in front are
     -+subtracted from that set.  The remaining commits are what comes out in the
     -+command's output.  Various other options and paths parameters can be used
     -+to further limit the result.
     ++You can think of this as a set operation. Commits reachable from any of
     ++the commits given on the command line form a set, and then commits reachable
     ++from any of the ones given with '{caret}' in front are subtracted from that
     ++set.  The remaining commits are what comes out in the command's output.
     ++Various other options and paths parameters can be used to further limit the
     ++result.
      +
      +Thus, the following command:
      +
      +-----------------------------------------------------------------------
     -+	$ git rev-list foo bar ^baz
     ++$ git rev-list foo bar ^baz
      +-----------------------------------------------------------------------
      +
      +means "list all the commits which are reachable from 'foo' or 'bar', but
      +not from 'baz'".
      +
      +A special notation "'<commit1>'..'<commit2>'" can be used as a
     -+short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
     ++short-hand for "^'<commit1>' '<commit2>'". For example, either of
      +the following may be used interchangeably:
      +
      +-----------------------------------------------------------------------
     -+	$ git rev-list origin..HEAD
     -+	$ git rev-list HEAD ^origin
     ++$ git rev-list origin..HEAD
     ++$ git rev-list HEAD ^origin
      +-----------------------------------------------------------------------
      +
      +Another special notation is "'<commit1>'...'<commit2>'" which is useful
     @@ Documentation/rev-list-description.txt (new)
      +between the two operands.  The following two commands are equivalent:
      +
      +-----------------------------------------------------------------------
     -+	$ git rev-list A B --not $(git merge-base --all A B)
     -+	$ git rev-list A...B
     ++$ git rev-list A B --not $(git merge-base --all A B)
     ++$ git rev-list A...B
      +-----------------------------------------------------------------------
 3:  eeaf4fe5dc ! 6:  d04b6c62a3 git-log.txt: include rev-list-description.txt
     @@ Documentation/git-log.txt: DESCRIPTION
      +
       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
     + the linkgit:git-diff[1] command to control how the changes
      
       ## Documentation/git-rev-list.txt ##
      @@ Documentation/git-rev-list.txt: SYNOPSIS
     @@ Documentation/git-rev-list.txt: SYNOPSIS
       'rev-list' is a very essential Git command, since it
      
       ## Documentation/rev-list-description.txt ##
     -@@ Documentation/rev-list-description.txt: to further limit the result.
     +@@ Documentation/rev-list-description.txt: result.
       
       Thus, the following command:
       
      +ifdef::git-rev-list[]
       -----------------------------------------------------------------------
     - 	$ git rev-list foo bar ^baz
     + $ git rev-list foo bar ^baz
       -----------------------------------------------------------------------
      +endif::git-rev-list[]
      +ifdef::git-log[]
      +-----------------------------------------------------------------------
     -+	$ git log foo bar ^baz
     ++$ git log foo bar ^baz
      +-----------------------------------------------------------------------
      +endif::git-log[]
       
       means "list all the commits which are reachable from 'foo' or 'bar', but
       not from 'baz'".
      @@ Documentation/rev-list-description.txt: A special notation "'<commit1>'..'<commit2>'" can be used as a
     - short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
     + short-hand for "^'<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
     + $ 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
     ++$ git log origin..HEAD
     ++$ git log HEAD ^origin
      +-----------------------------------------------------------------------
      +endif::git-log[]
       
     @@ Documentation/rev-list-description.txt: A special notation "'<commit1>'..'<commi
       
      +ifdef::git-rev-list[]
       -----------------------------------------------------------------------
     - 	$ git rev-list A B --not $(git merge-base --all A B)
     - 	$ git rev-list A...B
     + $ 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
     ++$ 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 17 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.