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

`--ancestry-path` documentation has wrong graph

From
Han Jiang <jhcarl0814@gmail.com>
Date
Mar 13, 2025, 21:04 UTC
Message-ID
<CANrWfmRq=7Q=vCPgmcLcek=fRsw83BPqTX7gTpcLb=JpQpYZEw@mail.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
Next: Elijah Newren
Message 1 of 7 in “`--ancestry-path` documentation has wrong graph”
  1. Han JiangMar 13, 2025
  2. Elijah NewrenMar 14, 2025
  3. Han JiangMar 15, 2025
  4. Elijah NewrenMar 15, 2025
  5. D. Ben KnobleMar 15, 2025
  6. Han JiangMar 15, 2025
  7. Han JiangMar 16, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.