Git development
 help / color / mirror / Atom feed
* [PATCH 0/2] combine-diff: fix patches for more than 32 parents
@ 2026-11-21 10:42 Aniket Gupta
  2026-11-21 10:42 ` [PATCH 1/2] combine-diff: fix the shift for the 33rd parent and later Aniket Gupta
  2026-11-21 10:42 ` [PATCH 2/2] combine-diff: do not show a patch for too many parents Aniket Gupta
  0 siblings, 2 replies; 3+ messages in thread
From: Aniket Gupta @ 2026-11-21 10:42 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Sami Jawhar, Patrick Steinhardt

This series fixes a bug that Sami Jawhar reported [1]: the combined
diff of a merge with more than 32 parents puts lines in the wrong
columns, and with 64 parents it shows no hunks at all.

Patch 1 is the actual fix. The shift that sets the bit of a parent in
the mask of a lost line was an int shift, so the 33rd parent and later
got the bit of another parent.

Patch 2 is for merges that are still too big for the masks which is more
than 62 parents where long has 64 bits. Instead of printing wrong
output, it now prints an error and skips the patch. I made it carry on
and not die. Now "git log --cc" will not stop halfway on a big octopus
merge. I am happy to change this if people prefer. On Windows, long has
32 bits, so the limit is 30 and the tests for more parents are skipped.

This is based on maint since the bug is old. The test suite passes and
CI on my fork is fine on Windows, macOS and Linux.

[1] https://lore.kernel.org/git/CAOJ8FdczW9KxFknceHodV0jmhyEB24OMtqQUmhkP3E2vfsmgag@mail.gmail.com/

Aniket Gupta (2):
  combine-diff: fix the shift for the 33rd parent and later
  combine-diff: do not show a patch for too many parents

 combine-diff.c           | 18 ++++++++++--
 t/t4038-diff-combined.sh | 60 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 2 deletions(-)

-- 
2.54.0 (Apple Git-157)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-21 10:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 10:42 [PATCH 0/2] combine-diff: fix patches for more than 32 parents Aniket Gupta
2026-11-21 10:42 ` [PATCH 1/2] combine-diff: fix the shift for the 33rd parent and later Aniket Gupta
2026-11-21 10:42 ` [PATCH 2/2] combine-diff: do not show a patch for too many parents Aniket Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox