# rev-list --ancestry-path with arg - bug or undocumented requirement

12 messages from 2024-11-19 to 2024-12-03. Participants: Kai Koponen, Elijah Newren, Junio C Hamano, Kristoffer Haugsbakk.
Thread: https://gitlist.dev/t/62518

## Kai Koponen, 2024-11-19 21:53

Subject: rev-list --ancestry-path with arg - bug or undocumented requirement
Message-ID: <CADYQcGpXm=RTEYyxqdSowQ4Vg9jmXuCzOOpd-TgDX8U814BReg@mail.gmail.com>
URL: https://gitlist.dev/e/CADYQcGpXm%3DRTEYyxqdSowQ4Vg9jmXuCzOOpd-TgDX8U814BReg%40mail.gmail.com

```
What did you do before the bug happened? (Steps to reproduce your issue)
Create a toy repo with commits in the following structure:
A - B - C
     \
      D

Run `git rev-list --ancestry-path=D A..C`.

What did you expect to happen? (Expected behavior)
Commits A and B should be listed.

What happened instead? (Actual behavior)
No commits listed.

What's different between what you expected and what actually happened?
--ancestry-path with a commit arg seems to return 0 results unless the
specified commit is itself part of the range. The rev-list documentation
does not mention that this is a requirement.


[System Info]
git version:
git version 2.47.0.338.g60cca15819-goog
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
libcurl: 8.8.0
OpenSSL: OpenSSL 3.3.2 3 Sep 2024
zlib: 1.3
compiler info: gnuc: 13.2
libc info: glibc: 2.38
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
commit-msg
pre-commit
prepare-commit-msg

```

## Elijah Newren, 2024-11-20 03:22

Subject: Re: rev-list --ancestry-path with arg - bug or undocumented requirement
Message-ID: <CABPp-BE1C2izp1a0Xm8_0KU+kas8XKejDyix+AzXqbCOeVp2Dg@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BE1C2izp1a0Xm8_0KU%2Bkas8XKejDyix%2BAzXqbCOeVp2Dg%40mail.gmail.com
In-Reply-To: <CADYQcGpXm=RTEYyxqdSowQ4Vg9jmXuCzOOpd-TgDX8U814BReg@mail.gmail.com>

```
On Tue, Nov 19, 2024 at 1:53 PM Kai Koponen <kaikoponen@google.com> wrote:
>
> What did you do before the bug happened? (Steps to reproduce your issue)
> Create a toy repo with commits in the following structure:
> A - B - C
>      \
>       D
>
> Run `git rev-list --ancestry-path=D A..C`.
>
> What did you expect to happen? (Expected behavior)
> Commits A and B should be listed.
>
> What happened instead? (Actual behavior)
> No commits listed.
>
> What's different between what you expected and what actually happened?
> --ancestry-path with a commit arg seems to return 0 results unless the
> specified commit is itself part of the range. The rev-list documentation
> does not mention that this is a requirement.

Yeah, the commit message that introduced --ancestry-path=COMMIT did
document this in its commit message (see
257418c59040c13bfa839e01922e21833cda6a52257418c59040 (revision: allow
--ancestry-path to take an argument, 2022-08-19)), and I think my
original documentation patch was a little clearer on this point, but
when Jonathan suggested an alternative for the documentation
(https://lore.kernel.org/git/20220818222416.3567602-1-jonathantanmy@google.com/),
I didn't think about someone attempting a commit outside the
ancestry-path as the argument.  My bad.

Based on the references above, would you like to suggest a
documentation patch to ensure this requirement is documented?

```

## Kai Koponen, 2024-12-02 19:45

Subject: Re: rev-list --ancestry-path with arg - bug or undocumented requirement
Message-ID: <CADYQcGpyTL18N2t8t-HwafB8VEVbBt452fsE0yMBvRvZd1mbVw@mail.gmail.com>
URL: https://gitlist.dev/e/CADYQcGpyTL18N2t8t-HwafB8VEVbBt452fsE0yMBvRvZd1mbVw%40mail.gmail.com
In-Reply-To: <CABPp-BE1C2izp1a0Xm8_0KU+kas8XKejDyix+AzXqbCOeVp2Dg@mail.gmail.com>

```
From 447a2367f8d3318e69adccc1b011b0d04792e438 Mon Sep 17 00:00:00 2001
From: Kai Koponen <kaikoponen@google.com>
Date: Mon, 2 Dec 2024 19:32:25 +0000
Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions

Signed-off-by: Kai Koponen <kaikopone@google.com>
---
 Documentation/rev-list-options.txt | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Documentation/rev-list-options.txt
b/Documentation/rev-list-options.txt
index 00ccf68744..1c678294af 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -412,12 +412,13 @@ Default mode::

 --ancestry-path[=<commit>]::
  When given a range of commits to display (e.g. 'commit1..commit2'
- or 'commit2 {caret}commit1'), only display commits in that range
- that are ancestors of <commit>, descendants of <commit>, or
- <commit> itself.  If no commit is specified, use 'commit1' (the
- excluded part of the range) as <commit>.  Can be passed multiple
- times; if so, a commit is included if it is any of the commits
- given or if it is an ancestor or descendant of one of them.
+ or 'commit2 {caret}commit1'), and a commit <commit> in that range,
+ only display commits in that range that are ancestors of <commit>,
+ descendants of <commit>, or <commit> itself. If no commit is
+ specified, use 'commit1' (the excluded part of the range) as
+ <commit>.  Can be passed multiple times; if so, a commit is
+ included if it is any of the commits given or if it is an ancestor
+ or descendant of one of them.

 A more detailed explanation follows.

-- 
2.47.0.338.g60cca15819-goog

On Tue, Nov 19, 2024 at 10:22 PM Elijah Newren <newren@gmail.com> wrote:
>
> On Tue, Nov 19, 2024 at 1:53 PM Kai Koponen <kaikoponen@google.com> wrote:
> >
> > What did you do before the bug happened? (Steps to reproduce your issue)
> > Create a toy repo with commits in the following structure:
> > A - B - C
> >      \
> >       D
> >
> > Run `git rev-list --ancestry-path=D A..C`.
> >
> > What did you expect to happen? (Expected behavior)
> > Commits A and B should be listed.
> >
> > What happened instead? (Actual behavior)
> > No commits listed.
> >
> > What's different between what you expected and what actually happened?
> > --ancestry-path with a commit arg seems to return 0 results unless the
> > specified commit is itself part of the range. The rev-list documentation
> > does not mention that this is a requirement.
>
> Yeah, the commit message that introduced --ancestry-path=COMMIT did
> document this in its commit message (see
> 257418c59040c13bfa839e01922e21833cda6a52257418c59040 (revision: allow
> --ancestry-path to take an argument, 2022-08-19)), and I think my
> original documentation patch was a little clearer on this point, but
> when Jonathan suggested an alternative for the documentation
> (https://lore.kernel.org/git/20220818222416.3567602-1-jonathantanmy@google.com/),
> I didn't think about someone attempting a commit outside the
> ancestry-path as the argument.  My bad.
>
> Based on the references above, would you like to suggest a
> documentation patch to ensure this requirement is documented?

```

## Elijah Newren, 2024-12-02 23:48

Subject: Re: rev-list --ancestry-path with arg - bug or undocumented requirement
Message-ID: <CABPp-BFzaf3K=LDk+Yp271M6hxdoPdW0G_T3OeNzfUEfkSCxuw@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BFzaf3K%3DLDk%2BYp271M6hxdoPdW0G_T3OeNzfUEfkSCxuw%40mail.gmail.com
In-Reply-To: <CADYQcGpyTL18N2t8t-HwafB8VEVbBt452fsE0yMBvRvZd1mbVw@mail.gmail.com>

```
On Mon, Dec 2, 2024 at 11:45 AM Kai Koponen <kaikoponen@google.com> wrote:
>
> From 447a2367f8d3318e69adccc1b011b0d04792e438 Mon Sep 17 00:00:00 2001
> From: Kai Koponen <kaikoponen@google.com>
> Date: Mon, 2 Dec 2024 19:32:25 +0000
> Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions
>
> Signed-off-by: Kai Koponen <kaikopone@google.com>
> ---
>  Documentation/rev-list-options.txt | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/rev-list-options.txt
> b/Documentation/rev-list-options.txt
> index 00ccf68744..1c678294af 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -412,12 +412,13 @@ Default mode::
>
>  --ancestry-path[=<commit>]::
>   When given a range of commits to display (e.g. 'commit1..commit2'
> - or 'commit2 {caret}commit1'), only display commits in that range
> - that are ancestors of <commit>, descendants of <commit>, or
> - <commit> itself.  If no commit is specified, use 'commit1' (the
> - excluded part of the range) as <commit>.  Can be passed multiple
> - times; if so, a commit is included if it is any of the commits
> - given or if it is an ancestor or descendant of one of them.
> + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> + only display commits in that range that are ancestors of <commit>,
> + descendants of <commit>, or <commit> itself. If no commit is
> + specified, use 'commit1' (the excluded part of the range) as
> + <commit>.  Can be passed multiple times; if so, a commit is
> + included if it is any of the commits given or if it is an ancestor
> + or descendant of one of them.

where the changes are the insertion of the phrase "and a commit
<commit> in that range,", which nicely captures the restriction.

This patch looks good to me, thanks.

>
>  A more detailed explanation follows.
>
> --
> 2.47.0.338.g60cca15819-goog

```

## Junio C Hamano, 2024-12-03 01:05

Subject: Re: rev-list --ancestry-path with arg - bug or undocumented requirement
Message-ID: <xmqqfrn5h8zj.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqfrn5h8zj.fsf%40gitster.g
In-Reply-To: <CADYQcGpyTL18N2t8t-HwafB8VEVbBt452fsE0yMBvRvZd1mbVw@mail.gmail.com>

```
Kai Koponen <kaikoponen@google.com> writes:

> From 447a2367f8d3318e69adccc1b011b0d04792e438 Mon Sep 17 00:00:00 2001

Do not include this line.

It is not a part of message, but merely added as a mark that a new
message starts here in case there are two or more patch e-mail
messages in a file.  Since you are sending one patch per one e-mail
message, you do not want it.

> From: Kai Koponen <kaikoponen@google.com>

Let your MUA have it on the From: header of your message; you do not
want this line when your MUA is configured correctly (and yours is;
we see From: header saying the same thing).

> Date: Mon, 2 Dec 2024 19:32:25 +0000

You do not want this, either.  Your MUA records on Date: header the
time general public saw this change for the first time.

> Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions

Put this in the e-mail header.  We add [PATCH] for a very good reason:
make it easier to find patches in the mailing list traffic.

>

Here is where you "sell" your changes by explaining why we are
making this change (like "existing text allows misinterpretation
that makes it sound like doing this and that are possible, which is
not true").  Please do not leave it empty.

> Signed-off-by: Kai Koponen <kaikopone@google.com>
> ---
>  Documentation/rev-list-options.txt | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/rev-list-options.txt
> b/Documentation/rev-list-options.txt
> index 00ccf68744..1c678294af 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -412,12 +412,13 @@ Default mode::
>
>  --ancestry-path[=<commit>]::
>   When given a range of commits to display (e.g. 'commit1..commit2'
> - or 'commit2 {caret}commit1'), only display commits in that range
> - that are ancestors of <commit>, descendants of <commit>, or
> - <commit> itself.  If no commit is specified, use 'commit1' (the
> - excluded part of the range) as <commit>.  Can be passed multiple
> - times; if so, a commit is included if it is any of the commits
> - given or if it is an ancestor or descendant of one of them.
> + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> + only display commits in that range that are ancestors of <commit>,
> + descendants of <commit>, or <commit> itself. If no commit is
> + specified, use 'commit1' (the excluded part of the range) as
> + <commit>.  Can be passed multiple times; if so, a commit is
> + included if it is any of the commits given or if it is an ancestor
> + or descendant of one of them.

As these files in Documentation/ are input to formatting programs,
please do not reflow the text unnecessarily so that what you changed
stand out, instead of forcing reviewers to go word-by-word to sift
through the changes to see what got really changed.

Thanks.

```

## Kai Koponen, 2024-12-03 17:14

Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <CADYQcGrD5KtM1sZQbccAtDaLmUXD8Gxv_nUWmapjfZm=TMq=Jw@mail.gmail.com>
URL: https://gitlist.dev/e/CADYQcGrD5KtM1sZQbccAtDaLmUXD8Gxv_nUWmapjfZm%3DTMq%3DJw%40mail.gmail.com
In-Reply-To: <xmqqfrn5h8zj.fsf@gitster.g>

```
The rev-list documentation doesn't mention that the given
commit must be in the specified commit range, leading
to unexpected results.

Signed-off-by: Kai Koponen <kaikopone@google.com>
---
 Documentation/rev-list-options.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/rev-list-options.txt
b/Documentation/rev-list-options.txt
index 00ccf68744..f0a46f9da5 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -412,7 +412,7 @@ Default mode::

 --ancestry-path[=<commit>]::
  When given a range of commits to display (e.g. 'commit1..commit2'
- or 'commit2 {caret}commit1'), only display commits in that range
+ or 'commit2 {caret}commit1'), and a commit <commit> in that range,
only display commits in that range
  that are ancestors of <commit>, descendants of <commit>, or
  <commit> itself.  If no commit is specified, use 'commit1' (the
  excluded part of the range) as <commit>.  Can be passed multiple
-- 
2.47.0.338.g60cca15819-goog

On Mon, Dec 2, 2024 at 8:05 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Kai Koponen <kaikoponen@google.com> writes:
>
> > From 447a2367f8d3318e69adccc1b011b0d04792e438 Mon Sep 17 00:00:00 2001
>
> Do not include this line.
>
> It is not a part of message, but merely added as a mark that a new
> message starts here in case there are two or more patch e-mail
> messages in a file.  Since you are sending one patch per one e-mail
> message, you do not want it.
>
> > From: Kai Koponen <kaikoponen@google.com>
>
> Let your MUA have it on the From: header of your message; you do not
> want this line when your MUA is configured correctly (and yours is;
> we see From: header saying the same thing).
>
> > Date: Mon, 2 Dec 2024 19:32:25 +0000
>
> You do not want this, either.  Your MUA records on Date: header the
> time general public saw this change for the first time.
>
> > Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions
>
> Put this in the e-mail header.  We add [PATCH] for a very good reason:
> make it easier to find patches in the mailing list traffic.
>
> >
>
> Here is where you "sell" your changes by explaining why we are
> making this change (like "existing text allows misinterpretation
> that makes it sound like doing this and that are possible, which is
> not true").  Please do not leave it empty.
>
> > Signed-off-by: Kai Koponen <kaikopone@google.com>
> > ---
> >  Documentation/rev-list-options.txt | 13 +++++++------
> >  1 file changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/Documentation/rev-list-options.txt
> > b/Documentation/rev-list-options.txt
> > index 00ccf68744..1c678294af 100644
> > --- a/Documentation/rev-list-options.txt
> > +++ b/Documentation/rev-list-options.txt
> > @@ -412,12 +412,13 @@ Default mode::
> >
> >  --ancestry-path[=<commit>]::
> >   When given a range of commits to display (e.g. 'commit1..commit2'
> > - or 'commit2 {caret}commit1'), only display commits in that range
> > - that are ancestors of <commit>, descendants of <commit>, or
> > - <commit> itself.  If no commit is specified, use 'commit1' (the
> > - excluded part of the range) as <commit>.  Can be passed multiple
> > - times; if so, a commit is included if it is any of the commits
> > - given or if it is an ancestor or descendant of one of them.
> > + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> > + only display commits in that range that are ancestors of <commit>,
> > + descendants of <commit>, or <commit> itself. If no commit is
> > + specified, use 'commit1' (the excluded part of the range) as
> > + <commit>.  Can be passed multiple times; if so, a commit is
> > + included if it is any of the commits given or if it is an ancestor
> > + or descendant of one of them.
>
> As these files in Documentation/ are input to formatting programs,
> please do not reflow the text unnecessarily so that what you changed
> stand out, instead of forcing reviewers to go word-by-word to sift
> through the changes to see what got really changed.
>
> Thanks.

```

## Kristoffer Haugsbakk, 2024-12-03 17:38

Subject: Re: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <3bf4e4bc-c807-4bbb-8920-afba077413b4@app.fastmail.com>
URL: https://gitlist.dev/e/3bf4e4bc-c807-4bbb-8920-afba077413b4%40app.fastmail.com
In-Reply-To: <CADYQcGrD5KtM1sZQbccAtDaLmUXD8Gxv_nUWmapjfZm=TMq=Jw@mail.gmail.com>

```
Hello Kai

On Tue, Dec 3, 2024, at 18:14, Kai Koponen wrote:
> The rev-list documentation doesn't mention that the given
> commit must be in the specified commit range, leading
> to unexpected results.
>
> Signed-off-by: Kai Koponen <kaikopone@google.com>
> ---
>  Documentation/rev-list-options.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I couldn’t apply this patch to `master` (cc01bad4a9f (The twelfth batch,
2024-11-27)). It looks like it is because..

>
> diff --git a/Documentation/rev-list-options.txt
> b/Documentation/rev-list-options.txt
> index 00ccf68744..f0a46f9da5 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -412,7 +412,7 @@ Default mode::
>
>  --ancestry-path[=<commit>]::
>   When given a range of commits to display (e.g. 'commit1..commit2'
> - or 'commit2 {caret}commit1'), only display commits in that range
> + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> only display commits in that range

This line got corrupted (linebreak).

I see that you used git-send-email(1).  Did you edit the patch file
manually in order to add the quotation from Junio below? I’m guessing
the editor then broke that line since it is 102 characters when
combined/joined.  I guess you could use cat(1) instead.  I like to use
Git Notes.  You can add a note to the commit and then use that default
namespace (commits) when making the patch.

    git notes edit
    git format-patch --notes=commits ...

Although in this case it might be better to add a linebreak since the
line gets so long. You can add one short line so that you don’t get the
reflow-paragraph problem from the previous version:

(these are with space indentation instead of tabs)

     --ancestry-path[=<commit>]::
            When given a range of commits to display (e.g. 'commit1..commit2'
    -       or 'commit2 {caret}commit1'), only display commits in that range
    +       or 'commit2 {caret}commit1'), only display commits in that range,
    +       and a commit <commit> in that range,
            that are ancestors of <commit>, descendants of <commit>, or
            <commit> itself.  If no commit is specified, use 'commit1' (the
            excluded part of the range) as <commit>.  Can be passed multiple

```

## Kai Koponen, 2024-12-03 17:59

Subject: Re: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <CADYQcGrME0wDrhDu6HQsX2Vo7A3bPPr3Ooio3bBFcBg6XaHuYQ@mail.gmail.com>
URL: https://gitlist.dev/e/CADYQcGrME0wDrhDu6HQsX2Vo7A3bPPr3Ooio3bBFcBg6XaHuYQ%40mail.gmail.com
In-Reply-To: <3bf4e4bc-c807-4bbb-8920-afba077413b4@app.fastmail.com>

```
Apologies, I made a mistake while copying the patch in manually from
format-patch; my git install doesn't have send-email available, I'll
fix that.

On Tue, Dec 3, 2024 at 12:39 PM Kristoffer Haugsbakk
<kristofferhaugsbakk@fastmail.com> wrote:
>
> Hello Kai
>
> On Tue, Dec 3, 2024, at 18:14, Kai Koponen wrote:
> > The rev-list documentation doesn't mention that the given
> > commit must be in the specified commit range, leading
> > to unexpected results.
> >
> > Signed-off-by: Kai Koponen <kaikopone@google.com>
> > ---
> >  Documentation/rev-list-options.txt | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> I couldn’t apply this patch to `master` (cc01bad4a9f (The twelfth batch,
> 2024-11-27)). It looks like it is because..
>
> >
> > diff --git a/Documentation/rev-list-options.txt
> > b/Documentation/rev-list-options.txt
> > index 00ccf68744..f0a46f9da5 100644
> > --- a/Documentation/rev-list-options.txt
> > +++ b/Documentation/rev-list-options.txt
> > @@ -412,7 +412,7 @@ Default mode::
> >
> >  --ancestry-path[=<commit>]::
> >   When given a range of commits to display (e.g. 'commit1..commit2'
> > - or 'commit2 {caret}commit1'), only display commits in that range
> > + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> > only display commits in that range
>
> This line got corrupted (linebreak).
>
> I see that you used git-send-email(1).  Did you edit the patch file
> manually in order to add the quotation from Junio below? I’m guessing
> the editor then broke that line since it is 102 characters when
> combined/joined.  I guess you could use cat(1) instead.  I like to use
> Git Notes.  You can add a note to the commit and then use that default
> namespace (commits) when making the patch.
>
>     git notes edit
>     git format-patch --notes=commits ...
>
> Although in this case it might be better to add a linebreak since the
> line gets so long. You can add one short line so that you don’t get the
> reflow-paragraph problem from the previous version:
>
> (these are with space indentation instead of tabs)
>
>      --ancestry-path[=<commit>]::
>             When given a range of commits to display (e.g. 'commit1..commit2'
>     -       or 'commit2 {caret}commit1'), only display commits in that range
>     +       or 'commit2 {caret}commit1'), only display commits in that range,
>     +       and a commit <commit> in that range,
>             that are ancestors of <commit>, descendants of <commit>, or
>             <commit> itself.  If no commit is specified, use 'commit1' (the
>             excluded part of the range) as <commit>.  Can be passed multiple

```

## Kai Koponen, 2024-12-03 20:21

Subject: Re: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <CADYQcGoTvGBbSyiA1ZuS4Vd=gai-rLa=Vke4fCfFrbERJmP1NA@mail.gmail.com>
URL: https://gitlist.dev/e/CADYQcGoTvGBbSyiA1ZuS4Vd%3Dgai-rLa%3DVke4fCfFrbERJmP1NA%40mail.gmail.com
In-Reply-To: <CADYQcGrME0wDrhDu6HQsX2Vo7A3bPPr3Ooio3bBFcBg6XaHuYQ@mail.gmail.com>

```
Re-trying via GitGitGadget at
https://lore.kernel.org/git/pull.1838.git.git.1733257083739.gitgitgadget@gmail.com/

On Tue, Dec 3, 2024 at 12:59 PM Kai Koponen <kaikoponen@google.com> wrote:
>
> Apologies, I made a mistake while copying the patch in manually from
> format-patch; my git install doesn't have send-email available, I'll
> fix that.
>
> On Tue, Dec 3, 2024 at 12:39 PM Kristoffer Haugsbakk
> <kristofferhaugsbakk@fastmail.com> wrote:
> >
> > Hello Kai
> >
> > On Tue, Dec 3, 2024, at 18:14, Kai Koponen wrote:
> > > The rev-list documentation doesn't mention that the given
> > > commit must be in the specified commit range, leading
> > > to unexpected results.
> > >
> > > Signed-off-by: Kai Koponen <kaikopone@google.com>
> > > ---
> > >  Documentation/rev-list-options.txt | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > I couldn’t apply this patch to `master` (cc01bad4a9f (The twelfth batch,
> > 2024-11-27)). It looks like it is because..
> >
> > >
> > > diff --git a/Documentation/rev-list-options.txt
> > > b/Documentation/rev-list-options.txt
> > > index 00ccf68744..f0a46f9da5 100644
> > > --- a/Documentation/rev-list-options.txt
> > > +++ b/Documentation/rev-list-options.txt
> > > @@ -412,7 +412,7 @@ Default mode::
> > >
> > >  --ancestry-path[=<commit>]::
> > >   When given a range of commits to display (e.g. 'commit1..commit2'
> > > - or 'commit2 {caret}commit1'), only display commits in that range
> > > + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> > > only display commits in that range
> >
> > This line got corrupted (linebreak).
> >
> > I see that you used git-send-email(1).  Did you edit the patch file
> > manually in order to add the quotation from Junio below? I’m guessing
> > the editor then broke that line since it is 102 characters when
> > combined/joined.  I guess you could use cat(1) instead.  I like to use
> > Git Notes.  You can add a note to the commit and then use that default
> > namespace (commits) when making the patch.
> >
> >     git notes edit
> >     git format-patch --notes=commits ...
> >
> > Although in this case it might be better to add a linebreak since the
> > line gets so long. You can add one short line so that you don’t get the
> > reflow-paragraph problem from the previous version:
> >
> > (these are with space indentation instead of tabs)
> >
> >      --ancestry-path[=<commit>]::
> >             When given a range of commits to display (e.g. 'commit1..commit2'
> >     -       or 'commit2 {caret}commit1'), only display commits in that range
> >     +       or 'commit2 {caret}commit1'), only display commits in that range,
> >     +       and a commit <commit> in that range,
> >             that are ancestors of <commit>, descendants of <commit>, or
> >             <commit> itself.  If no commit is specified, use 'commit1' (the
> >             excluded part of the range) as <commit>.  Can be passed multiple

```

## Junio C Hamano, 2024-12-03 23:24

Subject: Re: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <xmqqldww9won.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqldww9won.fsf%40gitster.g
In-Reply-To: <CADYQcGrD5KtM1sZQbccAtDaLmUXD8Gxv_nUWmapjfZm=TMq=Jw@mail.gmail.com>

```
Kai Koponen <kaikoponen@google.com> writes:

> The rev-list documentation doesn't mention that the given
> commit must be in the specified commit range, leading
> to unexpected results.
>
> Signed-off-by: Kai Koponen <kaikopone@google.com>
> ---
>  Documentation/rev-list-options.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/rev-list-options.txt
> b/Documentation/rev-list-options.txt
> index 00ccf68744..f0a46f9da5 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -412,7 +412,7 @@ Default mode::
>
>  --ancestry-path[=<commit>]::
>   When given a range of commits to display (e.g. 'commit1..commit2'
> - or 'commit2 {caret}commit1'), only display commits in that range
> + or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> only display commits in that range
>   that are ancestors of <commit>, descendants of <commit>, or
>   <commit> itself.  If no commit is specified, use 'commit1' (the
>   excluded part of the range) as <commit>.  Can be passed multiple

Thanks for accomodating my pickyness ;-)  This version reads very
well.

Will queue.


```

## Junio C Hamano, 2024-12-03 23:33

Subject: Re: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <xmqqa5dc9wa5.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqa5dc9wa5.fsf%40gitster.g
In-Reply-To: <3bf4e4bc-c807-4bbb-8920-afba077413b4@app.fastmail.com>

```
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:

> Hello Kai
>
> I couldn’t apply this patch to `master` (cc01bad4a9f (The twelfth batch,
> 2024-11-27)). It looks like it is because..

yes it is heavily whitespace damaged.  Here is what I applied after
manually reconstructing.

--- >8 ---
From: Kai Koponen <kaikoponen@google.com>
Date: Tue, 3 Dec 2024 12:14:34 -0500
Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions

The rev-list documentation doesn't mention that the given
commit must be in the specified commit range, leading
to unexpected results.

Signed-off-by: Kai Koponen <kaikopone@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/rev-list-options.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
index 0d90d5b154..9d5243e0aa 100644
--- a/Documentation/rev-list-options.txt
+++ b/Documentation/rev-list-options.txt
@@ -401,7 +401,8 @@ Default mode::
 
 --ancestry-path[=<commit>]::
 	When given a range of commits to display (e.g. 'commit1..commit2'
-	or 'commit2 {caret}commit1'), only display commits in that range
+	or 'commit2 {caret}commit1'), and a commit <commit> in that range,
+	only display commits in that range
 	that are ancestors of <commit>, descendants of <commit>, or
 	<commit> itself.  If no commit is specified, use 'commit1' (the
 	excluded part of the range) as <commit>.  Can be passed multiple
-- 
2.47.1-529-gecd20ec0f1


```

## Kai Koponen, 2024-12-03 23:36

Subject: Re: [PATCH] doc: mention rev-list --ancestry-path restrictions
Message-ID: <CADYQcGo_F2STr4BGOz2bbx2yVkQEKZ0ziFOGvBB8x=mSyCgDUA@mail.gmail.com>
URL: https://gitlist.dev/e/CADYQcGo_F2STr4BGOz2bbx2yVkQEKZ0ziFOGvBB8x%3DmSyCgDUA%40mail.gmail.com
In-Reply-To: <xmqqa5dc9wa5.fsf@gitster.g>

```
Thanks for fixing the mangling, pickiness is definitely called for a
huge project like this with lots of work on the maintainers. Wish
gmail didn't eat tabs in plain text mode... the github app was easier
to use than I expected though.

On Tue, Dec 3, 2024 at 6:33 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
>
> > Hello Kai
> >
> > I couldn’t apply this patch to `master` (cc01bad4a9f (The twelfth batch,
> > 2024-11-27)). It looks like it is because..
>
> yes it is heavily whitespace damaged.  Here is what I applied after
> manually reconstructing.
>
> --- >8 ---
> From: Kai Koponen <kaikoponen@google.com>
> Date: Tue, 3 Dec 2024 12:14:34 -0500
> Subject: [PATCH] doc: mention rev-list --ancestry-path restrictions
>
> The rev-list documentation doesn't mention that the given
> commit must be in the specified commit range, leading
> to unexpected results.
>
> Signed-off-by: Kai Koponen <kaikopone@google.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  Documentation/rev-list-options.txt | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
> index 0d90d5b154..9d5243e0aa 100644
> --- a/Documentation/rev-list-options.txt
> +++ b/Documentation/rev-list-options.txt
> @@ -401,7 +401,8 @@ Default mode::
>
>  --ancestry-path[=<commit>]::
>         When given a range of commits to display (e.g. 'commit1..commit2'
> -       or 'commit2 {caret}commit1'), only display commits in that range
> +       or 'commit2 {caret}commit1'), and a commit <commit> in that range,
> +       only display commits in that range
>         that are ancestors of <commit>, descendants of <commit>, or
>         <commit> itself.  If no commit is specified, use 'commit1' (the
>         excluded part of the range) as <commit>.  Can be passed multiple
> --
> 2.47.1-529-gecd20ec0f1
>

```
