# `--ancestry-path` documentation has wrong graph

7 messages from 2025-03-13 to 2025-03-16. Participants: Han Jiang, Elijah Newren, D. Ben Knoble.
Thread: https://gitlist.dev/t/63115

## Han Jiang, 2025-03-13 21:04

Subject: `--ancestry-path` documentation has wrong graph
Message-ID: <CANrWfmRq=7Q=vCPgmcLcek=fRsw83BPqTX7gTpcLb=JpQpYZEw@mail.gmail.com>
URL: https://gitlist.dev/e/CANrWfmRq%3D7Q%3DvCPgmcLcek%3DfRsw83BPqTX7gTpcLb%3DJpQpYZEw%40mail.gmail.com

```
Git - git-log Documentation --ancestry-path[=<commit>]
https://git-scm.com/docs/git-log#Documentation/git-log.txt---ancestry-pathltcommitgt-1

The graph for `--ancestry-path=H D..M` should contain commit C.

Code:

mkdir --parents -- './repo'
cd './repo'
git init
branch_default_name="$(git branch --show-current)"; echo "$branch_default_name"
git commit --message='a' --allow-empty
git checkout -b branch1
git commit --message='b' --allow-empty
git checkout -b branch2
git commit --message='d' --allow-empty
git commit --message='e' --allow-empty
git checkout branch1
git commit --message='c' --allow-empty
git merge --message='g' branch2
git checkout branch2
git commit --message='f' --allow-empty
git checkout branch1
git commit --message='h' --allow-empty
git merge --message='i' branch2
git commit --message='j' --allow-empty
git checkout "$branch_default_name"
git commit --message='k' --allow-empty
git merge --message='l' branch1
git commit --message='m' --allow-empty
git log --graph
git log --graph --ancestry-path=:/'h' :/'d'..:/'m'

Output:

* 9e6572c - 2025-03-14 09:54 (1 second ago) m (HEAD -> refs/heads/master)
*   9598130 - 2025-03-14 09:54 (2 seconds ago) l
|\
| * 3579336 - 2025-03-14 09:54 (5 seconds ago) j (refs/heads/branch1)
| *   a144397 - 2025-03-14 09:54 (5 seconds ago) i
| |\
| | * 721743e - 2025-03-14 09:54 (8 seconds ago) f (refs/heads/branch2)
| * | ceaf310 - 2025-03-14 09:54 (6 seconds ago) h
| * | 30e22bb - 2025-03-14 09:54 (9 seconds ago) g
| |\|
| | * 0f44e94 - 2025-03-14 09:54 (12 seconds ago) e
| | * edecedf - 2025-03-14 09:54 (13 seconds ago) d
| * | b4c952f - 2025-03-14 09:54 (10 seconds ago) c
| |/
| * 11851d5 - 2025-03-14 09:54 (14 seconds ago) b
* | 70c1b91 - 2025-03-14 09:54 (3 seconds ago) k
|/
* 029edb2 - 2025-03-14 09:54 (16 seconds ago) a

* 9e6572c - 2025-03-14 09:54 (1 second ago) m (HEAD -> refs/heads/master)
* 9598130 - 2025-03-14 09:54 (2 seconds ago) l
* 3579336 - 2025-03-14 09:54 (5 seconds ago) j (refs/heads/branch1)
* a144397 - 2025-03-14 09:54 (5 seconds ago) i
* ceaf310 - 2025-03-14 09:54 (6 seconds ago) h
*   30e22bb - 2025-03-14 09:54 (9 seconds ago) g
|\
| * 0f44e94 - 2025-03-14 09:54 (12 seconds ago) e
* b4c952f - 2025-03-14 09:54 (10 seconds ago) c

```

## Elijah Newren, 2025-03-14 17:16

Subject: Re: `--ancestry-path` documentation has wrong graph
Message-ID: <CABPp-BHPAEcJibTaiMVE1K7AvYE+TYmOt7=6XUtcZbm7wsWhDQ@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BHPAEcJibTaiMVE1K7AvYE%2BTYmOt7%3D6XUtcZbm7wsWhDQ%40mail.gmail.com
In-Reply-To: <CANrWfmRq=7Q=vCPgmcLcek=fRsw83BPqTX7gTpcLb=JpQpYZEw@mail.gmail.com>

```
On Thu, Mar 13, 2025 at 2:04 PM Han Jiang <jhcarl0814@gmail.com> wrote:
>
> Git - git-log Documentation --ancestry-path[=<commit>]
> https://git-scm.com/docs/git-log#Documentation/git-log.txt---ancestry-pathltcommitgt-1
>
> The graph for `--ancestry-path=H D..M` should contain commit C.

Indeed; D..H contains C, and C is an ancestor of H.  I apparently
overlooked C in that example when writing that documentation.  Would
you like to submit a patch, or would you like me to do so and record
you as the reporter?  I'm fine with either, but if you want to give it
a try, the relevant file is Documentation/rev-list-options.adoc in the
repository.

```

## Han Jiang, 2025-03-15 08:20

Subject: Re: `--ancestry-path` documentation has wrong graph
Message-ID: <CANrWfmRpDFuqv+fkCf_p_ggHTrRjD3Vgviqrai_rA7Lu-YFEMA@mail.gmail.com>
URL: https://gitlist.dev/e/CANrWfmRpDFuqv%2BfkCf_p_ggHTrRjD3Vgviqrai_rA7Lu-YFEMA%40mail.gmail.com
In-Reply-To: <CABPp-BHPAEcJibTaiMVE1K7AvYE+TYmOt7=6XUtcZbm7wsWhDQ@mail.gmail.com>

```
On Sat, Mar 15, 2025 at 6:16 AM Elijah Newren <newren@gmail.com> wrote:
>
> On Thu, Mar 13, 2025 at 2:04 PM Han Jiang <jhcarl0814@gmail.com> wrote:
> >
> > Git - git-log Documentation --ancestry-path[=<commit>]
> > https://git-scm.com/docs/git-log#Documentation/git-log.txt---ancestry-pathltcommitgt-1
> >
> > The graph for `--ancestry-path=H D..M` should contain commit C.
>
> Indeed; D..H contains C, and C is an ancestor of H.  I apparently
> overlooked C in that example when writing that documentation.  Would
> you like to submit a patch, or would you like me to do so and record
> you as the reporter?  I'm fine with either, but if you want to give it
> a try, the relevant file is Documentation/rev-list-options.adoc in the
> repository.

Thank you for the clarification! I'd like to try sending a patch.
After doing some research on how to make contributions today, I
decided to try GitGitGadget way first. But I got some questions that
the doc doesn't clearly explain:

[Git - CodingGuidelines
Documentation](https://git-scm.com/docs/CodingGuidelines) says:
For C programs: We use tabs to indent, and interpret tabs as taking up
to 8 spaces.
1. It seems adoc files treats tabs as 8 spaces too, is that true?
(The prepared commit in forked repository is at
https://github.com/jhcarl0814/git/commit/ce568e4a87dff14df4e7104af89be3f12616f5de
. The source diff shows tabs as 4 spaces. The rich diff shows tabs as
8 spaces. When I was editting the number defaults to 8 and is
adjustable in editor options.)

[Git - MyFirstContribution
Documentation](https://git-scm.com/docs/MyFirstContribution) says:
For single-patch contributions, your commit message should already be
meaningful and explain at a high level the purpose (what is happening
and why) of your patch, so you usually do not need any additional
context. In that case, remove the PR description that GitHub
automatically generates from your commit message (your PR description
should be empty).
2. For single-patch contributions, is the pull request title or the
first line of commit message that will become Subject of the email?

[Git - SubmittingPatches
Documentation](https://git-scm.com/docs/SubmittingPatches) says:
It is a common convention to prefix your subject line with [PATCH].
3. Which one of GitGitGadget or the pull request creator is the one
who add "[PATCH]" at the beginning of the title?

[Git - MyFirstContribution
Documentation](https://git-scm.com/docs/MyFirstContribution) says:
Now that your CI is passing and someone has granted you permission to
use GitGitGadget with the `/allow` command, sending out for review is
as simple as commenting on your PR with `/submit`.
4. Who is able to use `/submit` to trigger email sending action? Is it
the pull request creator (when `/allow`ed) or anyone (`/allow`ed)?
5. If `/submit` sends email, then how to cc all relevant people
(including myself) at the moment of `/submit`? Is there a place to
fill in this parameter?
6. Where does `/submit` send the email to, as a brand new post or as a
reply under this post? How to configure?

----

7. How to make Gmail web client default to bottom-posting?

```

## Elijah Newren, 2025-03-15 16:42

Subject: Re: `--ancestry-path` documentation has wrong graph
Message-ID: <CABPp-BHn6sPBh0CPctJ4-rM3rxGwXkbG4-o236dRV8FTwdP_nQ@mail.gmail.com>
URL: https://gitlist.dev/e/CABPp-BHn6sPBh0CPctJ4-rM3rxGwXkbG4-o236dRV8FTwdP_nQ%40mail.gmail.com
In-Reply-To: <CANrWfmRpDFuqv+fkCf_p_ggHTrRjD3Vgviqrai_rA7Lu-YFEMA@mail.gmail.com>

```
On Sat, Mar 15, 2025 at 1:21 AM Han Jiang <jhcarl0814@gmail.com> wrote:
>
> On Sat, Mar 15, 2025 at 6:16 AM Elijah Newren <newren@gmail.com> wrote:
> >
> > On Thu, Mar 13, 2025 at 2:04 PM Han Jiang <jhcarl0814@gmail.com> wrote:
> > >
> > > Git - git-log Documentation --ancestry-path[=<commit>]
> > > https://git-scm.com/docs/git-log#Documentation/git-log.txt---ancestry-pathltcommitgt-1
> > >
> > > The graph for `--ancestry-path=H D..M` should contain commit C.
> >
> > Indeed; D..H contains C, and C is an ancestor of H.  I apparently
> > overlooked C in that example when writing that documentation.  Would
> > you like to submit a patch, or would you like me to do so and record
> > you as the reporter?  I'm fine with either, but if you want to give it
> > a try, the relevant file is Documentation/rev-list-options.adoc in the
> > repository.
>
> Thank you for the clarification! I'd like to try sending a patch.
> After doing some research on how to make contributions today, I
> decided to try GitGitGadget way first. But I got some questions that
> the doc doesn't clearly explain:
>
> [Git - CodingGuidelines
> Documentation](https://git-scm.com/docs/CodingGuidelines) says:
> For C programs: We use tabs to indent, and interpret tabs as taking up
> to 8 spaces.
> 1. It seems adoc files treats tabs as 8 spaces too, is that true?
> (The prepared commit in forked repository is at
> https://github.com/jhcarl0814/git/commit/ce568e4a87dff14df4e7104af89be3f12616f5de
> . The source diff shows tabs as 4 spaces. The rich diff shows tabs as
> 8 spaces. When I was editting the number defaults to 8 and is
> adjustable in editor options.)

Yes, assume 8 spaces per tab.

Note that if you're worried, you can cd into the doc directory and run either
    make git-log.html
or
    make git-log.1

followed by then either
    <open your log git-log.html file in your web browser>
or
    man ./git-log.1

and look at how your changes modify the end result.

> [Git - MyFirstContribution
> Documentation](https://git-scm.com/docs/MyFirstContribution) says:
> For single-patch contributions, your commit message should already be
> meaningful and explain at a high level the purpose (what is happening
> and why) of your patch, so you usually do not need any additional
> context. In that case, remove the PR description that GitHub
> automatically generates from your commit message (your PR description
> should be empty).
> 2. For single-patch contributions, is the pull request title or the
> first line of commit message that will become Subject of the email?

Why would you make the pull request title and the first line of the
commit message different for a single-commit pull request?  That'd be
weird.

I have a guess at the answer, but only a guess.

> [Git - SubmittingPatches
> Documentation](https://git-scm.com/docs/SubmittingPatches) says:
> It is a common convention to prefix your subject line with [PATCH].
> 3. Which one of GitGitGadget or the pull request creator is the one
> who add "[PATCH]" at the beginning of the title?

GitGitGadget will add it for you.

> [Git - MyFirstContribution
> Documentation](https://git-scm.com/docs/MyFirstContribution) says:
> Now that your CI is passing and someone has granted you permission to
> use GitGitGadget with the `/allow` command, sending out for review is
> as simple as commenting on your PR with `/submit`.
> 4. Who is able to use `/submit` to trigger email sending action? Is it
> the pull request creator (when `/allow`ed) or anyone (`/allow`ed)?

Once you've been /allow'ed once, you can /submit that or any future
PRs of yours.

> 5. If `/submit` sends email, then how to cc all relevant people
> (including myself) at the moment of `/submit`? Is there a place to
> fill in this parameter?

In the PR description include a line of the form
   cc: User Name <user@email>

> 6. Where does `/submit` send the email to, as a brand new post or as a
> reply under this post? How to configure?

Brand new post, not configurable.  Just post a response to the
original thread with a link to the new submission.

Now, as kind of a summary of the answers to many of these questions
and perhaps others:

If you want to see an example, take a look at and compare
   https://github.com/gitgitgadget/git/pull/1864
with
   https://lore.kernel.org/git/pull.1864.git.1740139296483.gitgitgadget@gmail.com/

You'll be able to see the cc in action, see where the commit message
and pr description go, see how the subject has '[PATCH] '
auto-prepended, etc.

```

## D. Ben Knoble, 2025-03-15 21:50

Subject: Re: `--ancestry-path` documentation has wrong graph
Message-ID: <CALnO6CCppGXFHoL1jSkUWQUh41=RHb346hW6Qr9hFJpTawEW=Q@mail.gmail.com>
URL: https://gitlist.dev/e/CALnO6CCppGXFHoL1jSkUWQUh41%3DRHb346hW6Qr9hFJpTawEW%3DQ%40mail.gmail.com
In-Reply-To: <CANrWfmRpDFuqv+fkCf_p_ggHTrRjD3Vgviqrai_rA7Lu-YFEMA@mail.gmail.com>

```
On Sat, Mar 15, 2025 at 4:21 AM Han Jiang <jhcarl0814@gmail.com> wrote:
>
>
> 7. How to make Gmail web client default to bottom-posting?

AFAIK, you cannot :/


-- 
D. Ben Knoble

```

## Han Jiang, 2025-03-15 23:51

Subject: Re: `--ancestry-path` documentation has wrong graph
Message-ID: <CANrWfmQdnrGmGW3ot9e0DU0vEbstrOsqzh9Puv9dy0Zsr7zQcQ@mail.gmail.com>
URL: https://gitlist.dev/e/CANrWfmQdnrGmGW3ot9e0DU0vEbstrOsqzh9Puv9dy0Zsr7zQcQ%40mail.gmail.com
In-Reply-To: <CALnO6CCppGXFHoL1jSkUWQUh41=RHb346hW6Qr9hFJpTawEW=Q@mail.gmail.com>

```
Thank you for the help!
The pull request has been created:
https://github.com/gitgitgadget/git/pull/1883 . I'll `/submit` when
someone `/allow`s me. (I'll also `/submit` before I'm `/allow`ed to
see what the bot would say.)
According to https://datatracker.ietf.org/doc/html/rfc4021 and
https://datatracker.ietf.org/doc/html/rfc5322 mails can use `:`
instead of `:<at least one whitespace>` to separate mail header and
address list, use `,` instead of `,<at least one whitespace>` to
separate multiple `address`es. According to
https://datatracker.ietf.org/doc/html/rfc5322 and
https://datatracker.ietf.org/doc/html/rfc5234, strings such as "Cc:"
are case-insensitive. I'm just testing these in the `Cc` field.

On Sun, Mar 16, 2025 at 10:50 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
>
> On Sat, Mar 15, 2025 at 4:21 AM Han Jiang <jhcarl0814@gmail.com> wrote:
> >
> >
> > 7. How to make Gmail web client default to bottom-posting?
>
> AFAIK, you cannot :/
>
>
> --
> D. Ben Knoble

```

## Han Jiang, 2025-03-16 01:59

Subject: Re: `--ancestry-path` documentation has wrong graph
Message-ID: <CANrWfmTFavk=q_h2yk6ORZnWyqyaANPnQ5vWiWXWXze5ng5C7Q@mail.gmail.com>
URL: https://gitlist.dev/e/CANrWfmTFavk%3Dq_h2yk6ORZnWyqyaANPnQ5vWiWXWXze5ng5C7Q%40mail.gmail.com
In-Reply-To: <CANrWfmQdnrGmGW3ot9e0DU0vEbstrOsqzh9Puv9dy0Zsr7zQcQ@mail.gmail.com>

```
The patch is `/submit`ted to the mailing list:
https://lore.kernel.org/git/pull.1883.git.1742089659610.gitgitgadget@gmail.com/
.
Seems either or both of changing case of case-insensitive header and
removing optional spaces prevented the bot from parsing the cc line
correctly. (And I somehow got cc-ed twice.) I'll try again in the
future someday when I have a chance.

On Sun, Mar 16, 2025 at 12:51 PM Han Jiang <jhcarl0814@gmail.com> wrote:
>
> Thank you for the help!
> The pull request has been created:
> https://github.com/gitgitgadget/git/pull/1883 . I'll `/submit` when
> someone `/allow`s me. (I'll also `/submit` before I'm `/allow`ed to
> see what the bot would say.)
> According to https://datatracker.ietf.org/doc/html/rfc4021 and
> https://datatracker.ietf.org/doc/html/rfc5322 mails can use `:`
> instead of `:<at least one whitespace>` to separate mail header and
> address list, use `,` instead of `,<at least one whitespace>` to
> separate multiple `address`es. According to
> https://datatracker.ietf.org/doc/html/rfc5322 and
> https://datatracker.ietf.org/doc/html/rfc5234, strings such as "Cc:"
> are case-insensitive. I'm just testing these in the `Cc` field.
>
> On Sun, Mar 16, 2025 at 10:50 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> >
> > On Sat, Mar 15, 2025 at 4:21 AM Han Jiang <jhcarl0814@gmail.com> wrote:
> > >
> > >
> > > 7. How to make Gmail web client default to bottom-posting?
> >
> > AFAIK, you cannot :/
> >
> >
> > --
> > D. Ben Knoble

```
