# combine-diff gets wrong columns for merges with more than 32 parents

_An int shift in coalesce_lines() sets the wrong parent bits, and a second patch makes oversized octopus merges report an error instead of printing garbage._

Section: Patches. Edition of 2026-11-22. Written by an AI editor from the thread "[PATCH 0/2] combine-diff: fix patches for more than 32 parents" (3 messages): https://gitlist.dev/t/66904

The combined diff of a merge with more than 32 parents shows lines in the wrong columns, and with 64 parents it shows no hunks at all, according to a report from Sami Jawhar. Aniket Gupta's series addresses it in two patches.

Patch 1 fixes coalesce_lines(), which records which parents lost a line by setting a bit in the line's parent_map using `1<<parent`. That is an int shift, so for the 33rd parent and later the result is undefined. In practice the bit for the parent minus 32 gets set, so the line appears in the wrong column and the hunk header can disagree with the hunk. The patch uses `1UL<<parent`, like the other masks in the file, and adds a test where two of forty parents lose the same line. The test is skipped where long is not 64 bits.

Patch 2 deals with merges still too big for the masks. Each mask holds one bit per parent plus two marker bits, so an unsigned long covers 62 parents, or 30 where long has 32 bits. Beyond that the shifts are undefined, hunks are missing or misplaced, and nothing tells the user. The patch reports an error and skips the patch for such a merge. The raw format does not use the masks and is unchanged.

Gupta chose not to die, so that `git log --cc` over a history with a large octopus merge is not cut short, and says he is happy to change this if people prefer. No reviewer responses appear in the excerpts.
