[PATCH 0/2] combine-diff: fix patches for more than 32 parents
- From
- Aniket Gupta <aniketgupta3001@gmail.com>
- Date
- Nov 21, 2026, 10:42 UTC
- Message-ID
- <20261121104234.98386-1-aniketgupta3001@gmail.com>
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)