]> git.99rst.org Git - git.git/commit
revision: honor --exclude-first-parent-only with SEEN first parent
authorJunio C Hamano <redacted>
Wed, 22 Jul 2026 17:03:13 +0000 (10:03 -0700)
committerJunio C Hamano <redacted>
Wed, 22 Jul 2026 21:00:02 +0000 (14:00 -0700)
commit47382f7398df0c8509c30aac6aafa75272099ca5
tree808ada47b4d67fb6253778483175ce37583fba82
parent94f057755b7941b321fd11fec1b2e3ca5313a4e0
revision: honor --exclude-first-parent-only with SEEN first parent

The '--exclude-first-parent-only' option instructs the revision
walker to follow only the first parent of a merge commit to
propagate down the UNINTERESTING bit.

However, if the first parent has already been marked SEEN (for
example, because it was explicitly specified on the command line),
process_parents() skips it with a 'continue' statement.  But the
loop then continues on to process the second parent, because the
check for the '--exclude-first-parent-only' option is near the end
of the loop, which the 'continue' statement skips.  Consequently, we
end up marking the second parent as UNINTERESTING.

Break out of the loop instead of continuing when the first parent is
already SEEN or fails to parse.  This ensures that we do not process
subsequent parents and mark them as UNINTERESTING.

Signed-off-by: Junio C Hamano <redacted>
Reviewed-by: Jerry Zhang <redacted>
Signed-off-by: Junio C Hamano <redacted>
revision.c
t/t6012-rev-list-simplify.sh
git clone https://git.99rst.org/PROJECT