threads / discuss / 63115

`--ancestry-path` documentation has wrong graph

Subject: `--ancestry-path` documentation has wrong graph

## tl;dr

7 messages between Mar 13, 2025 and Mar 16, 2025.

replies: 6people: 3as markdown or json

Han Jiang· Mar 13, 2025, 21:04 UTC · lore

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· Mar 14, 2025, 17:16 UTC · re: Han Jiang · lore

Re: `--ancestry-path` documentation has wrong graph

On Thu, Mar 13, 2025 at 2:04 PM Han Jiang <jhcarl0814@gmail.com> wrote:
Show 5 quoted lines
>
> 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· Mar 15, 2025, 08:20 UTC · re: Elijah Newren · lore

Re: `--ancestry-path` documentation has wrong graph

On Sat, Mar 15, 2025 at 6:16 AM Elijah Newren <newren@gmail.com> wrote:
Show 14 quoted lines
>
> 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· Mar 15, 2025, 16:42 UTC · re: Han Jiang · lore

Re: `--ancestry-path` documentation has wrong graph

On Sat, Mar 15, 2025 at 1:21 AM Han Jiang <jhcarl0814@gmail.com> wrote:
Show 32 quoted lines
>
> 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.
Show 10 quoted lines
> [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.
Show 5 quoted lines
> [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.
Show 7 quoted lines
> [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· Mar 15, 2025, 21:50 UTC · re: Han Jiang · lore

Re: `--ancestry-path` documentation has wrong graph

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· Mar 15, 2025, 23:51 UTC · re: D. Ben Knoble · lore

Re: `--ancestry-path` documentation has wrong graph

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:
Show 11 quoted lines
>
> 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· Mar 16, 2025, 01:59 UTC · re: Han Jiang · lore

Re: `--ancestry-path` documentation has wrong graph

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:
Show 27 quoted lines
>
> 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

← back to recent threads