git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] doc: log takes multiple revision ranges
@ 2020-03-28 21:11 Philippe Blain via GitGitGadget
  2020-03-29  1:34 ` Junio C Hamano
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  0 siblings, 2 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-03-28 21:11 UTC (permalink / raw)
  To: git; +Cc: Martin Ågren, Alex Henrie, Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

`git log` accepts multiple revision ranges, but makes no mention of that
in its documentation. Currently readers have to go to the `git
rev-list` documentation to discover this useful feature.

Mention it and adjust the synopsys in the doc and in the short
help for `git log`.

Also add links to the documentation for `git rev-list` and `git diff`
instead of simply mentioning them, to make it easier for readers to reach
these documentation pages. Let's link to `git diff` as this is the
porcelain command, and the rest of the family (`diff-index`, `diff-tree` and
`diff-files`) are mentioned in the "Raw output format" section of the
`git diff` documentation.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
    doc: log takes multiple revision ranges
    
    I hesitated to send this in two patches but decided not to, if it would
    be preferred I'll split it.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-590%2Fphil-blain%2Fdoc-log-multiple-ranges-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-590/phil-blain/doc-log-multiple-ranges-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/590

 Documentation/git-log.txt | 12 ++++++------
 builtin/log.c             |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index bed09bb09e5..fa8affd436a 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -9,15 +9,15 @@ git-log - Show commit logs
 SYNOPSIS
 --------
 [verse]
-'git log' [<options>] [<revision range>] [[--] <path>...]
+'git log' [<options>] [<revision range>...] [[--] <path>...]
 
 DESCRIPTION
 -----------
 Shows the commit logs.
 
-The command takes options applicable to the `git rev-list`
+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
 each commit introduces are shown.
 
 
@@ -90,9 +90,9 @@ include::line-range-format.txt[]
 	<revision range> is specified, it defaults to `HEAD` (i.e. the
 	whole history leading to the current commit).  `origin..HEAD`
 	specifies all the commits reachable from the current commit
-	(i.e. `HEAD`), but not from `origin`. For a complete list of
-	ways to spell <revision range>, see the 'Specifying Ranges'
-	section of linkgit:gitrevisions[7].
+	(i.e. `HEAD`), but not from `origin`. You can give more than 
+	one revision range. For a complete list of ways to spell <revision range>,
+	see the 'Specifying Ranges' section of linkgit:gitrevisions[7]. 
 
 [--] <path>...::
 	Show only commits that are enough to explain how the files
diff --git a/builtin/log.c b/builtin/log.c
index 83a4a6188e2..51c2ef54823 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -53,7 +53,7 @@ static const char *fmt_patch_subject_prefix = "PATCH";
 static const char *fmt_pretty;
 
 static const char * const builtin_log_usage[] = {
-	N_("git log [<options>] [<revision-range>] [[--] <path>...]"),
+	N_("git log [<options>] [<revision-range>...] [[--] <path>...]"),
 	N_("git show [<options>] <object>..."),
 	NULL
 };

base-commit: 076cbdcd739aeb33c1be87b73aebae5e43d7bcc5
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: log takes multiple revision ranges
  2020-03-28 21:11 [PATCH] doc: log takes multiple revision ranges Philippe Blain via GitGitGadget
@ 2020-03-29  1:34 ` Junio C Hamano
  2020-03-30 12:52   ` Philippe Blain
  2020-03-31 21:53   ` Taylor Blau
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  1 sibling, 2 replies; 23+ messages in thread
From: Junio C Hamano @ 2020-03-29  1:34 UTC (permalink / raw)
  To: Philippe Blain via GitGitGadget
  Cc: git, Martin Ågren, Alex Henrie, Philippe Blain

"Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Philippe Blain <levraiphilippeblain@gmail.com>
>
> `git log` accepts multiple revision ranges, but makes no mention of that
> in its documentation. Currently readers have to go to the `git
> rev-list` documentation to discover this useful feature.

I have a mixed feeling about this change.  Surely you can write

	git log   v1.0..v2.0   v4.0..v5.0 -- Makefile

and you can explain that the command appears to take two "ranges",
but I do not think we want to encourage it to those who do not
understand what the above actually *means*.  

Specifially, it does *NOT* list commits between v1.0 and v2.0, or
between v4.0 and v5.0, that touch the path Makefile.  In other
words, you didn't really give two ranges with the syntax.  What the
A..B notation means could be called a range, only when it appears
alone.

And we have *no* intention of changing the semantics.

"A..B" is a mere short-hand for ^A B, and it may appear to be a
range, but "A..B C..D" does not make "two ranges".  It still merely
is a short-hand for ^A B ^C D, and if C reaches A and B (in the
above example, v4.0 is very likely to reach both v1.0 and v2.0), it
means the same thing as "C..D", i.e. "git log v4.0..v5.0 -- Makefile".

So I have a mildly strong opinion against the change to the synopsys
and the short-help; it is a bad change that does not help users.  If
there are not sufficient explanation on the equivalence between A..B
and ^A B on "git log" documentation but there is one elsewhere, adding
a reference to help users learn is very much appreciated, though, and
I initially was hoping that the second hunk of this patch was such a
change, but it appears that it is not (it just adds the misleading
"you can have more than one" without making readers aware of what it
means to write "A..B C..D").

Thanks.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: log takes multiple revision ranges
  2020-03-29  1:34 ` Junio C Hamano
@ 2020-03-30 12:52   ` Philippe Blain
  2020-03-30 17:09     ` Junio C Hamano
  2020-07-05 20:42     ` Philip Oakley
  2020-03-31 21:53   ` Taylor Blau
  1 sibling, 2 replies; 23+ messages in thread
From: Philippe Blain @ 2020-03-30 12:52 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Philippe Blain via GitGitGadget, git, Martin Ågren, Alex Henrie

Hi Junio, 
> Le 28 mars 2020 à 21:34, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Philippe Blain <levraiphilippeblain@gmail.com>
>> 
>> `git log` accepts multiple revision ranges, but makes no mention of that
>> in its documentation. Currently readers have to go to the `git
>> rev-list` documentation to discover this useful feature.
> 
> I have a mixed feeling about this change.  Surely you can write
> 
> 	git log   v1.0..v2.0   v4.0..v5.0 -- Makefile
> 
> and you can explain that the command appears to take two "ranges",
> but I do not think we want to encourage it to those who do not
> understand what the above actually *means*.  
> 
> Specifially, it does *NOT* list commits between v1.0 and v2.0, or
> between v4.0 and v5.0, that touch the path Makefile.  In other
> words, you didn't really give two ranges with the syntax.  What the
> A..B notation means could be called a range, only when it appears
> alone.
> 
> And we have *no* intention of changing the semantics.

Of course, I understand.

> 
> "A..B" is a mere short-hand for ^A B, and it may appear to be a
> range, but "A..B C..D" does not make "two ranges".  It still merely
> is a short-hand for ^A B ^C D, and if C reaches A and B (in the
> above example, v4.0 is very likely to reach both v1.0 and v2.0), it
> means the same thing as "C..D", i.e. "git log v4.0..v5.0 -- Makefile".

Yes, you are right.

> 
> So I have a mildly strong opinion against the change to the synopsys
> and the short-help; it is a bad change that does not help users.  If
> there are not sufficient explanation on the equivalence between A..B
> and ^A B on "git log" documentation but there is one elsewhere, adding
> a reference to help users learn is very much appreciated, though,

So the 'git log' documentation states: 

    origin..HEAD specifies all the commits reachable from the current commit 
    (i.e. HEAD), but not from origin. For a complete list of ways to spell <revision range>, 
    see the Specifying Ranges section of gitrevisions[7].

What I wanted to achieve with this patch is to make readers 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. Even following the link to gitrevisions[7], 
it is not explicitly mentioned in the "Specifying Ranges" section 
that a range denotes the set of all commits reachable by all given refs, 
minus the ones reachable by all given refs prefixed by '^' or '--not'.
However, this is really clear in the 'git rev-list' documentation, 
which uses  '<commit>...' in the synopsis
and clearly talks about the "set of commits" point of view:

    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 ^ 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.

Do you think it would be appropriate that this explanation could somehow also appear 
in the 'git log' (and maybe also 'gitrevisions') documentation ?

Thanks for the quick feedback,
Philippe.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: log takes multiple revision ranges
  2020-03-30 12:52   ` Philippe Blain
@ 2020-03-30 17:09     ` Junio C Hamano
  2020-07-05 20:42     ` Philip Oakley
  1 sibling, 0 replies; 23+ messages in thread
From: Junio C Hamano @ 2020-03-30 17:09 UTC (permalink / raw)
  To: Philippe Blain
  Cc: Philippe Blain via GitGitGadget, git, Martin Ågren, Alex Henrie

Philippe Blain <levraiphilippeblain@gmail.com> writes:

> However, this is really clear in the 'git rev-list' documentation, 
> which uses  '<commit>...' in the synopsis
> and clearly talks about the "set of commits" point of view:
>
>     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 ^ 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.
>
> Do you think it would be appropriate that this explanation could somehow also appear 
> in the 'git log' (and maybe also 'gitrevisions') documentation ?

Thanks for finding that paragraph.  

I said in my previous message that I didn't think the synopsis and
short-help changes were bad, and I hoped that the other hunk of the
patch added reference to "git log" page that existed elsewhere to
help readers understand what the positive and negative options do.
A reference to the "set operation" is exactly the kind of addition I
meant I hoped to see.

By the way, I do not write "git log ab/topic-1 cd/topic-2 --not master",
but "git log ^master ab/topic-1 cd/topic-2 ef/topic-3" is something I'd
quite often write.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: log takes multiple revision ranges
  2020-03-29  1:34 ` Junio C Hamano
  2020-03-30 12:52   ` Philippe Blain
@ 2020-03-31 21:53   ` Taylor Blau
  1 sibling, 0 replies; 23+ messages in thread
From: Taylor Blau @ 2020-03-31 21:53 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Philippe Blain via GitGitGadget, git, Martin Ågren,
	Alex Henrie, Philippe Blain

On Sat, Mar 28, 2020 at 06:34:14PM -0700, Junio C Hamano wrote:
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > From: Philippe Blain <levraiphilippeblain@gmail.com>
> >
> > `git log` accepts multiple revision ranges, but makes no mention of that
> > in its documentation. Currently readers have to go to the `git
> > rev-list` documentation to discover this useful feature.
>
> I have a mixed feeling about this change.  Surely you can write
>
> 	git log   v1.0..v2.0   v4.0..v5.0 -- Makefile
>
> and you can explain that the command appears to take two "ranges",
> but I do not think we want to encourage it to those who do not
> understand what the above actually *means*.
>
> Specifially, it does *NOT* list commits between v1.0 and v2.0, or
> between v4.0 and v5.0, that touch the path Makefile.  In other
> words, you didn't really give two ranges with the syntax.  What the
> A..B notation means could be called a range, only when it appears
> alone.
>
> And we have *no* intention of changing the semantics.
>
> "A..B" is a mere short-hand for ^A B, and it may appear to be a
> range, but "A..B C..D" does not make "two ranges".  It still merely
> is a short-hand for ^A B ^C D, and if C reaches A and B (in the
> above example, v4.0 is very likely to reach both v1.0 and v2.0), it
> means the same thing as "C..D", i.e. "git log v4.0..v5.0 -- Makefile".
>
> So I have a mildly strong opinion against the change to the synopsys
> and the short-help; it is a bad change that does not help users.

I second this opinion. I think that reading:

  [<revision range> [...]]

is very misleading. It guides the reader to think that they can specify
multiple ranges, but does not provide clear guidance about how multiple
ranges are interpreted. I think most readers will naturally assume that
the interpretation is "take the union of each provided range", but this
is not the case as Junio points out.

> If there are not sufficient explanation on the equivalence between
> A..B and ^A B on "git log" documentation but there is one elsewhere,
> adding a reference to help users learn is very much appreciated,
> though, and I initially was hoping that the second hunk of this patch
> was such a change, but it appears that it is not (it just adds the
> misleading "you can have more than one" without making readers aware
> of what it means to write "A..B C..D").

I think the documentation is probably clearer as it is. Having this
extra explanation about the difference between the two doesn't guarantee
that it will be read, so it may just be adding additional complexity
that isn't warranted ;).

> Thanks.

Thanks,
Taylor

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 0/4] doc: include git rev-list description in git log doc
  2020-03-28 21:11 [PATCH] doc: log takes multiple revision ranges Philippe Blain via GitGitGadget
  2020-03-29  1:34 ` Junio C Hamano
@ 2020-07-03  3:38 ` Philippe Blain via GitGitGadget
  2020-07-03  3:38   ` [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
                     ` (4 more replies)
  1 sibling, 5 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-03  3:38 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philippe Blain

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 (4):
  git-log.txt: add links to 'rev-list' and 'diff' docs
  git-rev-list.txt: move description to separate file
  git-log.txt: include rev-list-description.txt
  rev-list-description.txt: fix Asciidoc syntax

 Documentation/git-log.txt              |  7 ++-
 Documentation/git-rev-list.txt         | 40 +----------------
 Documentation/rev-list-description.txt | 61 ++++++++++++++++++++++++++
 3 files changed, 68 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-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-590/phil-blain/doc-log-multiple-ranges-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/590

Range-diff vs v1:

 1:  16b8cdb55c ! 1:  59c48282a0 doc: log takes multiple revision ranges
     @@ Metadata
      Author: Philippe Blain <levraiphilippeblain@gmail.com>
      
       ## Commit message ##
     -    doc: log takes multiple revision ranges
     +    git-log.txt: add links to 'rev-list' and 'diff' docs
      
     -    `git log` accepts multiple revision ranges, but makes no mention of that
     -    in its documentation. Currently readers have to go to the `git
     -    rev-list` documentation to discover this useful feature.
     -
     -    Mention it and adjust the synopsys in the doc and in the short
     -    help for `git log`.
     -
     -    Also add links to the documentation for `git rev-list` and `git diff`
     +    Add links to the documentation for `git rev-list` and `git diff`
          instead of simply mentioning them, to make it easier for readers to reach
          these documentation pages. Let's link to `git diff` as this is the
          porcelain command, and the rest of the family (`diff-index`, `diff-tree` and
     @@ Commit message
          Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
      
       ## Documentation/git-log.txt ##
     -@@ Documentation/git-log.txt: git-log - Show commit logs
     - SYNOPSIS
     - --------
     - [verse]
     --'git log' [<options>] [<revision range>] [[--] <path>...]
     -+'git log' [<options>] [<revision range>...] [[--] <path>...]
     - 
     - DESCRIPTION
     +@@ Documentation/git-log.txt: DESCRIPTION
       -----------
       Shows the commit logs.
       
     @@ Documentation/git-log.txt: git-log - Show commit logs
       each commit introduces are shown.
       
       
     -@@ Documentation/git-log.txt: include::line-range-format.txt[]
     - 	<revision range> is specified, it defaults to `HEAD` (i.e. the
     - 	whole history leading to the current commit).  `origin..HEAD`
     - 	specifies all the commits reachable from the current commit
     --	(i.e. `HEAD`), but not from `origin`. For a complete list of
     --	ways to spell <revision range>, see the 'Specifying Ranges'
     --	section of linkgit:gitrevisions[7].
     -+	(i.e. `HEAD`), but not from `origin`. You can give more than 
     -+	one revision range. For a complete list of ways to spell <revision range>,
     -+	see the 'Specifying Ranges' section of linkgit:gitrevisions[7]. 
     - 
     - [--] <path>...::
     - 	Show only commits that are enough to explain how the files
     -
     - ## builtin/log.c ##
     -@@ builtin/log.c: static const char *fmt_patch_subject_prefix = "PATCH";
     - static const char *fmt_pretty;
     - 
     - static const char * const builtin_log_usage[] = {
     --	N_("git log [<options>] [<revision-range>] [[--] <path>...]"),
     -+	N_("git log [<options>] [<revision-range>...] [[--] <path>...]"),
     - 	N_("git show [<options>] <object>..."),
     - 	NULL
     - };
 -:  ---------- > 2:  daf00d9398 git-rev-list.txt: move description to separate file
 -:  ---------- > 3:  eeaf4fe5dc git-log.txt: include rev-list-description.txt
 -:  ---------- > 4:  3b923780c1 rev-list-description.txt: fix Asciidoc syntax

-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
@ 2020-07-03  3:38   ` Philippe Blain via GitGitGadget
  2020-07-07  0:55     ` Junio C Hamano
  2020-07-03  3:38   ` [PATCH v2 2/4] git-rev-list.txt: move description to separate file Philippe Blain via GitGitGadget
                     ` (3 subsequent siblings)
  4 siblings, 1 reply; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-03  3:38 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

Add links to the documentation for `git rev-list` and `git diff`
instead of simply mentioning them, to make it easier for readers to reach
these documentation pages. Let's link to `git diff` as this is the
porcelain command, and the rest of the family (`diff-index`, `diff-tree` and
`diff-files`) are mentioned in the "Raw output format" section of the
`git diff` documentation.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/git-log.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 20e6d21a74..04ea18d1c0 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -15,9 +15,9 @@ DESCRIPTION
 -----------
 Shows the commit logs.
 
-The command takes options applicable to the `git rev-list`
+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
 each commit introduces are shown.
 
 
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 2/4] git-rev-list.txt: move description to separate file
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  2020-07-03  3:38   ` [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
@ 2020-07-03  3:38   ` Philippe Blain via GitGitGadget
  2020-07-03  3:38   ` [PATCH v2 3/4] git-log.txt: include rev-list-description.txt Philippe Blain via GitGitGadget
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-03  3:38 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

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>
---
 Documentation/git-rev-list.txt         | 39 +-------------------------
 Documentation/rev-list-description.txt | 38 +++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 38 deletions(-)
 create mode 100644 Documentation/rev-list-description.txt

diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 025c911436..b06e11ae56 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -14,44 +14,7 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
-List commits that are reachable by following the `parent` links from the
-given commit(s), but exclude commits that are reachable from the one(s)
-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.
-
-Thus, the following command:
-
------------------------------------------------------------------------
-	$ 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
-the following may be used interchangeably:
-
------------------------------------------------------------------------
-	$ git rev-list origin..HEAD
-	$ git rev-list HEAD ^origin
------------------------------------------------------------------------
-
-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:
-
------------------------------------------------------------------------
-	$ git rev-list A B --not $(git merge-base --all A B)
-	$ git rev-list A...B
------------------------------------------------------------------------
+include::rev-list-description.txt[]
 
 'rev-list' is a very essential Git command, since it
 provides the ability to build and traverse commit ancestry graphs. For
diff --git a/Documentation/rev-list-description.txt b/Documentation/rev-list-description.txt
new file mode 100644
index 0000000000..aa6bbd8cec
--- /dev/null
+++ b/Documentation/rev-list-description.txt
@@ -0,0 +1,38 @@
+List commits that are reachable by following the `parent` links from the
+given commit(s), but exclude commits that are reachable from the one(s)
+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.
+
+Thus, the following command:
+
+-----------------------------------------------------------------------
+	$ 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
+the following may be used interchangeably:
+
+-----------------------------------------------------------------------
+	$ git rev-list origin..HEAD
+	$ git rev-list HEAD ^origin
+-----------------------------------------------------------------------
+
+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:
+
+-----------------------------------------------------------------------
+	$ git rev-list A B --not $(git merge-base --all A B)
+	$ git rev-list A...B
+-----------------------------------------------------------------------
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 3/4] git-log.txt: include rev-list-description.txt
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  2020-07-03  3:38   ` [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
  2020-07-03  3:38   ` [PATCH v2 2/4] git-rev-list.txt: move description to separate file Philippe Blain via GitGitGadget
@ 2020-07-03  3:38   ` Philippe Blain via GitGitGadget
  2020-07-03  3:38   ` [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  4 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-03  3:38 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philippe Blain, Philippe Blain

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


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
                     ` (2 preceding siblings ...)
  2020-07-03  3:38   ` [PATCH v2 3/4] git-log.txt: include rev-list-description.txt Philippe Blain via GitGitGadget
@ 2020-07-03  3:38   ` Philippe Blain via GitGitGadget
  2020-07-07  0:59     ` Junio C Hamano
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  4 siblings, 1 reply; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-03  3:38 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

Using '{caret}' inside double quotes and immediately following with a
single quoted word does not create the desired output: '<commit1>'
appears verbatim instead of being emphasized.

Use a litteral caret ('^') instead.

Also, remove the leading tabs in shell examples to bring them more in
line with the rest of the documentation.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/rev-list-description.txt | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Documentation/rev-list-description.txt b/Documentation/rev-list-description.txt
index dce78561be..4bde2fd4fe 100644
--- a/Documentation/rev-list-description.txt
+++ b/Documentation/rev-list-description.txt
@@ -14,12 +14,12 @@ 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[]
 
@@ -27,19 +27,19 @@ 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:
 
 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[]
 
@@ -49,13 +49,13 @@ 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[]
-- 
gitgitgadget

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: log takes multiple revision ranges
  2020-03-30 12:52   ` Philippe Blain
  2020-03-30 17:09     ` Junio C Hamano
@ 2020-07-05 20:42     ` Philip Oakley
  2020-07-07 13:08       ` Philippe Blain
  1 sibling, 1 reply; 23+ messages in thread
From: Philip Oakley @ 2020-07-05 20:42 UTC (permalink / raw)
  To: Philippe Blain, Junio C Hamano
  Cc: Philippe Blain via GitGitGadget, git, Martin Ågren, Alex Henrie

Hi Philippe,
This had been sitting in my inbox..

On 30/03/2020 13:52, Philippe Blain wrote:
> Hi Junio, 
>> Le 28 mars 2020 à 21:34, Junio C Hamano <gitster@pobox.com> a écrit :
>>
>> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
>>
>>> From: Philippe Blain <levraiphilippeblain@gmail.com>
>>>
>>> `git log` accepts multiple revision ranges, but makes no mention of that
>>> in its documentation. Currently readers have to go to the `git
>>> rev-list` documentation to discover this useful feature.

I'd concur that sometime the documentation is not as educationally
informative  as it could be. Often it leaves readers to second guess
what is meant, or redirects to other reference sections with similar
presumptions that the reader already understands.  Documentation is
harder than coding because of these differences in writing style. Often
Git appears to prefer the normative standard style.

>> I have a mixed feeling about this change.  Surely you can write
>>
>> 	git log   v1.0..v2.0   v4.0..v5.0 -- Makefile
>>
>> and you can explain that the command appears to take two "ranges",
>> but I do not think we want to encourage it to those who do not
>> understand what the above actually *means*.  
>>
>> Specifially, it does *NOT* list commits between v1.0 and v2.0, or
>> between v4.0 and v5.0, that touch the path Makefile.  In other
>> words, you didn't really give two ranges with the syntax.  What the
>> A..B notation means could be called a range, only when it appears
>> alone.
>>
>> And we have *no* intention of changing the semantics.
> Of course, I understand.
>
>> "A..B" is a mere short-hand for ^A B, and it may appear to be a
>> range, but "A..B C..D" does not make "two ranges".  It still merely
>> is a short-hand for ^A B ^C D, and if C reaches A and B (in the
>> above example, v4.0 is very likely to reach both v1.0 and v2.0), it
>> means the same thing as "C..D", i.e. "git log v4.0..v5.0 -- Makefile".
> Yes, you are right.
>
>> So I have a mildly strong opinion against the change to the synopsys
>> and the short-help; it is a bad change that does not help users.  If
>> there are not sufficient explanation on the equivalence between A..B
>> and ^A B on "git log" documentation but there is one elsewhere, adding
>> a reference to help users learn is very much appreciated, though,
> So the 'git log' documentation states: 
>
>     origin..HEAD specifies all the commits reachable from the current commit 
>     (i.e. HEAD), but not from origin. For a complete list of ways to spell <revision range>, 
>     see the Specifying Ranges section of gitrevisions[7].
>
> What I wanted to achieve with this patch is to make readers 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. 

The whole revision walk stuff is tricky. Finding the right starting
point for explanations is key, along with picking out where 'normal'
errors are made, as these do help users who aren't simply 'checking the
manual'. (the 20-20 hindsight problem)

For example, your "that are not on master", and what that means, needs
to be brought out to the new reader rather than being buried
mid-sentence. Most readers will miss those mid-sentence key points and
they can't learn until they have some significant problem that points it
out to them. Sometime we need to point at the 'wrong' things, not just
the right things. (e.g. if branch3 had ben merged a couple of revisions
ago...)

> Even following the link to gitrevisions[7], 
> it is not explicitly mentioned in the "Specifying Ranges" section 
> that a range denotes the set of all commits reachable by all given refs, 
> minus the ones reachable by all given refs prefixed by '^' or '--not'.
> However, this is really clear in the 'git rev-list' documentation, 
> which uses  '<commit>...' in the synopsis
> and clearly talks about the "set of commits" point of view:
>
>     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 ^ 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.
>
Set operations don't help everyone, just sayin'.

In some cases: The fact that we exclude any commit reachable from any of
the "^" commits should be mentioned first, and then we select any left
that are reachable from the named tips. This puts a different spin on
the  understanding, and helps catch those that have not understood the
other descriptions. It can then be easily linked to the 'two ranges'
case producing otherwise unexpected results.
> Do you think it would be appropriate that this explanation could somehow also appear 
> in the 'git log' (and maybe also 'gitrevisions') documentation ?
>
> Thanks for the quick feedback,
> Philippe.
Philip

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs
  2020-07-03  3:38   ` [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
@ 2020-07-07  0:55     ` Junio C Hamano
  2020-07-07 13:11       ` Philippe Blain
  0 siblings, 1 reply; 23+ messages in thread
From: Junio C Hamano @ 2020-07-07  0:55 UTC (permalink / raw)
  To: Philippe Blain via GitGitGadget
  Cc: git, Lawrence Siebert, Denton Liu, Taylor Blau, Philippe Blain

"Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Philippe Blain <levraiphilippeblain@gmail.com>
>
> Add links to the documentation for `git rev-list` and `git diff`
> instead of simply mentioning them, to make it easier for readers to reach
> these documentation pages. Let's link to `git diff` as this is the
> porcelain command, and the rest of the family (`diff-index`, `diff-tree` and
> `diff-files`) are mentioned in the "Raw output format" section of the
> `git diff` documentation.
>
> Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
> ---
>  Documentation/git-log.txt | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
> index 20e6d21a74..04ea18d1c0 100644
> --- a/Documentation/git-log.txt
> +++ b/Documentation/git-log.txt
> @@ -15,9 +15,9 @@ DESCRIPTION
>  -----------
>  Shows the commit logs.
>  
> -The command takes options applicable to the `git rev-list`
> +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
>  each commit introduces are shown.

The original did mean "git diff-*" family of plumbing commands, but
I think it makes more sense these days to just refer to "git diff"
Porcelain, which is the single entry point everybody uses.  So you
would probably want to further replace "family of commands" with
just "command" in the text.

Other than that, I think making these into links is a good idea.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax
  2020-07-03  3:38   ` [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
@ 2020-07-07  0:59     ` Junio C Hamano
  2020-07-07 13:12       ` Philippe Blain
  0 siblings, 1 reply; 23+ messages in thread
From: Junio C Hamano @ 2020-07-07  0:59 UTC (permalink / raw)
  To: Philippe Blain via GitGitGadget
  Cc: git, Lawrence Siebert, Denton Liu, Taylor Blau, Philippe Blain

"Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Philippe Blain <levraiphilippeblain@gmail.com>
>
> Using '{caret}' inside double quotes and immediately following with a
> single quoted word does not create the desired output: '<commit1>'
> appears verbatim instead of being emphasized.
>
> Use a litteral caret ('^') instead.
>
> Also, remove the leading tabs in shell examples to bring them more in
> line with the rest of the documentation.

These should be done _before_ 2/4 as a preliminary clean-up, I
think.

Thanks for a pleasant read.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH] doc: log takes multiple revision ranges
  2020-07-05 20:42     ` Philip Oakley
@ 2020-07-07 13:08       ` Philippe Blain
  0 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain @ 2020-07-07 13:08 UTC (permalink / raw)
  To: Philip Oakley
  Cc: Junio C Hamano, Philippe Blain via GitGitGadget, git,
	Martin Ågren, Alex Henrie

Hi Philip,

> Le 5 juil. 2020 à 16:42, Philip Oakley <philipoakley@iee.email> a écrit :
> 
> Hi Philippe,
> This had been sitting in my inbox..
> 
-----8<-----
>> 
>> What I wanted to achieve with this patch is to make readers 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. 
> 
> The whole revision walk stuff is tricky. Finding the right starting
> point for explanations is key, along with picking out where 'normal'
> errors are made, as these do help users who aren't simply 'checking the
> manual'. (the 20-20 hindsight problem)
> 
> For example, your "that are not on master", and what that means, needs
> to be brought out to the new reader rather than being buried
> mid-sentence. Most readers will miss those mid-sentence key points and
> they can't learn until they have some significant problem that points it
> out to them. Sometime we need to point at the 'wrong' things, not just
> the right things. (e.g. if branch3 had ben merged a couple of revisions
> ago...)

Yes, here I meant "on master" in the "not yet merged into master" sense, of course.
I'd be more careful if I was writing a commit message or part of the doc itself.

> 
>> Even following the link to gitrevisions[7], 
>> it is not explicitly mentioned in the "Specifying Ranges" section 
>> that a range denotes the set of all commits reachable by all given refs, 
>> minus the ones reachable by all given refs prefixed by '^' or '--not'.
>> However, this is really clear in the 'git rev-list' documentation, 
>> which uses  '<commit>...' in the synopsis
>> and clearly talks about the "set of commits" point of view:
>> 
>>    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 ^ 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.
>> 
> Set operations don't help everyone, just sayin'.
> 
> In some cases: The fact that we exclude any commit reachable from any of
> the "^" commits should be mentioned first, and then we select any left
> that are reachable from the named tips. This puts a different spin on
> the  understanding, and helps catch those that have not understood the
> other descriptions. It can then be easily linked to the 'two ranges'
> case producing otherwise unexpected results.

I'll try to tweak the wording for v3.

Thanks,
Philippe.


^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs
  2020-07-07  0:55     ` Junio C Hamano
@ 2020-07-07 13:11       ` Philippe Blain
  0 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain @ 2020-07-07 13:11 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Philippe Blain via GitGitGadget, git, Lawrence Siebert,
	Denton Liu, Taylor Blau

Hi Junio,

> Le 6 juil. 2020 à 20:55, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Philippe Blain <levraiphilippeblain@gmail.com>
>> 
---8<---
>> 
>> -The command takes options applicable to the `git rev-list`
>> +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
>> each commit introduces are shown.
> 
> The original did mean "git diff-*" family of plumbing commands, but
> I think it makes more sense these days to just refer to "git diff"
> Porcelain, which is the single entry point everybody uses.  So you
> would probably want to further replace "family of commands" with
> just "command" in the text.
> 

Right. I'll change that.

> Other than that, I think making these into links is a good idea.

Thanks,
Philippe.

P.S. sorry for the resend, I forgot to convert the message to plain text the first time...

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax
  2020-07-07  0:59     ` Junio C Hamano
@ 2020-07-07 13:12       ` Philippe Blain
  0 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain @ 2020-07-07 13:12 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: Philippe Blain via GitGitGadget, git, Lawrence Siebert,
	Denton Liu, Taylor Blau


> Le 6 juil. 2020 à 20:59, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
>> From: Philippe Blain <levraiphilippeblain@gmail.com>
>> 
>> Using '{caret}' inside double quotes and immediately following with a
>> single quoted word does not create the desired output: '<commit1>'
>> appears verbatim instead of being emphasized.
>> 
>> Use a litteral caret ('^') instead.
>> 
>> Also, remove the leading tabs in shell examples to bring them more in
>> line with the rest of the documentation.
> 
> These should be done _before_ 2/4 as a preliminary clean-up, I
> think.

I agree. I'll reorder that for v3.



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 0/6] doc: include git rev-list description in git log doc
  2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
                     ` (3 preceding siblings ...)
  2020-07-03  3:38   ` [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
@ 2020-07-09  2:16   ` Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 1/6] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
                       ` (5 more replies)
  4 siblings, 6 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 1/6] git-log.txt: add links to 'rev-list' and 'diff' docs
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
@ 2020-07-09  2:16     ` Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 2/6] revisions.txt: describe 'rev1 rev2 ...' meaning for ranges Philippe Blain via GitGitGadget
                       ` (4 subsequent siblings)
  5 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

Add links to the documentation for `git rev-list` and `git diff`
instead of simply mentioning them, to make it easier for readers to reach
these documentation pages. Let's link to `git diff` as this is the
porcelain command, and the rest of the family (`diff-index`, `diff-tree` and
`diff-files`) are mentioned in the "Raw output format" section of the
`git diff` documentation.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/git-log.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/git-log.txt b/Documentation/git-log.txt
index 20e6d21a74..0fcaf34d62 100644
--- a/Documentation/git-log.txt
+++ b/Documentation/git-log.txt
@@ -15,9 +15,9 @@ DESCRIPTION
 -----------
 Shows the commit logs.
 
-The command takes options applicable to the `git rev-list`
+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] command to control how the changes
 each commit introduces are shown.
 
 
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 2/6] revisions.txt: describe 'rev1 rev2 ...' meaning for ranges
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 1/6] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
@ 2020-07-09  2:16     ` Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 3/6] git-rev-list.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
                       ` (3 subsequent siblings)
  5 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

The "Specifying ranges" section does not mention explicitly that
several commits can be specified to form a range.

Add a mention to that effect.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/revisions.txt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/revisions.txt b/Documentation/revisions.txt
index 1ad95065c1..d9169c062e 100644
--- a/Documentation/revisions.txt
+++ b/Documentation/revisions.txt
@@ -254,6 +254,9 @@ specifying a single revision, using the notation described in the
 previous section, means the set of commits `reachable` from the given
 commit.
 
+Specifying several revisions means the set of commits reachable from
+any of the given commits.
+
 A commit's reachable set is the commit itself and the commits in
 its ancestry chain.
 
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 3/6] git-rev-list.txt: fix Asciidoc syntax
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 1/6] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 2/6] revisions.txt: describe 'rev1 rev2 ...' meaning for ranges Philippe Blain via GitGitGadget
@ 2020-07-09  2:16     ` Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 4/6] git-rev-list.txt: tweak wording in set operations Philippe Blain via GitGitGadget
                       ` (2 subsequent siblings)
  5 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

Using '{caret}' inside double quotes and immediately following with a
single quoted word does not create the desired output: '<commit1>'
appears verbatim instead of being emphasized.

Use a litteral caret ('^') instead.

Also, remove the leading tabs in shell examples to bring them more in
line with the rest of the documentation.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/git-rev-list.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index 025c911436..aa95334a79 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -29,19 +29,19 @@ 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
@@ -49,8 +49,8 @@ for merges.  The resulting set of commits is the symmetric difference
 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
 -----------------------------------------------------------------------
 
 'rev-list' is a very essential Git command, since it
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 4/6] git-rev-list.txt: tweak wording in set operations
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
                       ` (2 preceding siblings ...)
  2020-07-09  2:16     ` [PATCH v3 3/6] git-rev-list.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
@ 2020-07-09  2:16     ` Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 5/6] git-rev-list.txt: move description to separate file Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 6/6] git-log.txt: include rev-list-description.txt Philippe Blain via GitGitGadget
  5 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

Tweak a sentence to make it a little more readable.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
---
 Documentation/git-rev-list.txt | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index aa95334a79..f2b83df2fa 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -19,12 +19,12 @@ given commit(s), but exclude commits that are reachable from the one(s)
 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:
 
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 5/6] git-rev-list.txt: move description to separate file
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
                       ` (3 preceding siblings ...)
  2020-07-09  2:16     ` [PATCH v3 4/6] git-rev-list.txt: tweak wording in set operations Philippe Blain via GitGitGadget
@ 2020-07-09  2:16     ` Philippe Blain via GitGitGadget
  2020-07-09  2:16     ` [PATCH v3 6/6] git-log.txt: include rev-list-description.txt Philippe Blain via GitGitGadget
  5 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain, Philippe Blain

From: Philippe Blain <levraiphilippeblain@gmail.com>

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>
---
 Documentation/git-rev-list.txt         | 39 +-------------------------
 Documentation/rev-list-description.txt | 38 +++++++++++++++++++++++++
 2 files changed, 39 insertions(+), 38 deletions(-)
 create mode 100644 Documentation/rev-list-description.txt

diff --git a/Documentation/git-rev-list.txt b/Documentation/git-rev-list.txt
index f2b83df2fa..b06e11ae56 100644
--- a/Documentation/git-rev-list.txt
+++ b/Documentation/git-rev-list.txt
@@ -14,44 +14,7 @@ SYNOPSIS
 DESCRIPTION
 -----------
 
-List commits that are reachable by following the `parent` links from the
-given commit(s), but exclude commits that are reachable from the one(s)
-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 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
------------------------------------------------------------------------
-
-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 "^'<commit1>' '<commit2>'". For example, either of
-the following may be used interchangeably:
-
------------------------------------------------------------------------
-$ git rev-list origin..HEAD
-$ git rev-list HEAD ^origin
------------------------------------------------------------------------
-
-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:
-
------------------------------------------------------------------------
-$ git rev-list A B --not $(git merge-base --all A B)
-$ git rev-list A...B
------------------------------------------------------------------------
+include::rev-list-description.txt[]
 
 'rev-list' is a very essential Git command, since it
 provides the ability to build and traverse commit ancestry graphs. For
diff --git a/Documentation/rev-list-description.txt b/Documentation/rev-list-description.txt
new file mode 100644
index 0000000000..14d78b91aa
--- /dev/null
+++ b/Documentation/rev-list-description.txt
@@ -0,0 +1,38 @@
+List commits that are reachable by following the `parent` links from the
+given commit(s), but exclude commits that are reachable from the one(s)
+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 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
+-----------------------------------------------------------------------
+
+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 "^'<commit1>' '<commit2>'". For example, either of
+the following may be used interchangeably:
+
+-----------------------------------------------------------------------
+$ git rev-list origin..HEAD
+$ git rev-list HEAD ^origin
+-----------------------------------------------------------------------
+
+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:
+
+-----------------------------------------------------------------------
+$ git rev-list A B --not $(git merge-base --all A B)
+$ git rev-list A...B
+-----------------------------------------------------------------------
-- 
gitgitgadget


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [PATCH v3 6/6] git-log.txt: include rev-list-description.txt
  2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
                       ` (4 preceding siblings ...)
  2020-07-09  2:16     ` [PATCH v3 5/6] git-rev-list.txt: move description to separate file Philippe Blain via GitGitGadget
@ 2020-07-09  2:16     ` Philippe Blain via GitGitGadget
  5 siblings, 0 replies; 23+ messages in thread
From: Philippe Blain via GitGitGadget @ 2020-07-09  2:16 UTC (permalink / raw)
  To: git
  Cc: Lawrence Siebert, Denton Liu, Junio C Hamano, Taylor Blau,
	Philip Oakley, Philippe Blain, Philippe Blain

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 0fcaf34d62..3fd26d5212 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] command 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 14d78b91aa..a9efa7fa27 100644
--- a/Documentation/rev-list-description.txt
+++ b/Documentation/rev-list-description.txt
@@ -12,9 +12,16 @@ 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 "^'<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

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2020-07-09  2:17 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-28 21:11 [PATCH] doc: log takes multiple revision ranges Philippe Blain via GitGitGadget
2020-03-29  1:34 ` Junio C Hamano
2020-03-30 12:52   ` Philippe Blain
2020-03-30 17:09     ` Junio C Hamano
2020-07-05 20:42     ` Philip Oakley
2020-07-07 13:08       ` Philippe Blain
2020-03-31 21:53   ` Taylor Blau
2020-07-03  3:38 ` [PATCH v2 0/4] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
2020-07-03  3:38   ` [PATCH v2 1/4] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
2020-07-07  0:55     ` Junio C Hamano
2020-07-07 13:11       ` Philippe Blain
2020-07-03  3:38   ` [PATCH v2 2/4] git-rev-list.txt: move description to separate file Philippe Blain via GitGitGadget
2020-07-03  3:38   ` [PATCH v2 3/4] git-log.txt: include rev-list-description.txt Philippe Blain via GitGitGadget
2020-07-03  3:38   ` [PATCH v2 4/4] rev-list-description.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
2020-07-07  0:59     ` Junio C Hamano
2020-07-07 13:12       ` Philippe Blain
2020-07-09  2:16   ` [PATCH v3 0/6] doc: include git rev-list description in git log doc Philippe Blain via GitGitGadget
2020-07-09  2:16     ` [PATCH v3 1/6] git-log.txt: add links to 'rev-list' and 'diff' docs Philippe Blain via GitGitGadget
2020-07-09  2:16     ` [PATCH v3 2/6] revisions.txt: describe 'rev1 rev2 ...' meaning for ranges Philippe Blain via GitGitGadget
2020-07-09  2:16     ` [PATCH v3 3/6] git-rev-list.txt: fix Asciidoc syntax Philippe Blain via GitGitGadget
2020-07-09  2:16     ` [PATCH v3 4/6] git-rev-list.txt: tweak wording in set operations Philippe Blain via GitGitGadget
2020-07-09  2:16     ` [PATCH v3 5/6] git-rev-list.txt: move description to separate file Philippe Blain via GitGitGadget
2020-07-09  2:16     ` [PATCH v3 6/6] git-log.txt: include rev-list-description.txt Philippe Blain via GitGitGadget

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).