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

Bug report - git rev-list --exclude-first-parent-only [SEC=UNOFFICIAL]

From
MHMichael Hore <michael.hore@asic.gov.au>
Date
Jul 2, 2026, 03:59 UTC
Message-ID
<ME2PR01MB5490E3CE825C83474D1573CED1F52@ME2PR01MB5490.ausprd01.prod.outlook.com>
I believe I have found a bug -
My repo has a commit structure like
R2
|\
| F
|/
R1
i.e.
 - there is a merge commit R2 with parents R1 and F
 - the parent of F is R1
I ran "git rev-list --exclude-first-parent-only F ^R2"
it gave the expected result: "F"
I ran "git rev-list --exclude-first-parent-only F R1 ^R2"
I expected the same result, but I got an unexpected result - nothing at all
Suspected cause - I had a look at the code, and it looks like process_parents() in revision.c, when processing uninteresting flags, will skip the 1st parent and mark the 2nd parent as uninteresting if the 1st parent is already SEEN, even with the flag exclude-first-parent-only. I think maybe explicitly selecting R1 on the command line causes it to be marked SEEN before ^R2 is processed, thus resulting in F being marked uninteresting.
[System Info]
git version:
git version 2.54.0.windows.1
cpu: x86_64
built from commit: 2b8a3ab140826ac423c2845ef81d4c6ac4f7bf3c
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
rust: disabled
feature: fsmonitor--daemon
gettext: enabled
SHA-1: SHA1_DC
SHA-256: SHA256_BLK
default-ref-format: files
default-hash: sha1
[Enabled Hooks]

Regards, Michael

Please consider the environment before printing this document.
Information collected by ASIC may contain personal information. Please refer to our Privacy Policy<https://asic.gov.au/privacy/> for information about how we handle your personal information, your rights to seek access to and correct your personal information, and how to complain about breaches of your privacy by ASIC.
This e-mail and any attachments are intended for the addressee(s) only and may be confidential. They may contain legally privileged, copyright material or personal and /or confidential information. You should not read, copy, use or disclose the content without authorisation. If you have received this email in error, please notify the sender as soon as possible, delete the email and destroy any copies. This notice should not be removed.
Next: Junio C Hamano
Message 1 of 3 in “Bug report - git rev-list --exclude-first-parent-only [SEC=UNOFFICIAL]”
  1. Michael HoreJul 2, 2026
  2. Junio C HamanoJul 3, 2026
  3. Jerry ZhangJul 21, 2026

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.