Re: [PATCH] [Outreachy] patch-ids: fix const correctness
- From
- Okhuomon Ajayi <okhuomonajayi54@gmail.com>
- Date
- Oct 13, 2025, 17:22 UTC
- Message-ID
- <CAFpMFfBXhfy7ecBzR-cnGViivQG3AHGrQ00vSTnVY6OdxZPSLg@mail.gmail.com>
- In-Reply-To
- <xmqq4is23evz.fsf@gitster.g>
Thanks, that explains it.
I didn’t compile test before sending my mistake. I see now that opt is passed into commit_patch_id() (and friends) and those functions modify the diff_options structure, so making opt const is incorrect. The real issue is the mismatch introduced by the hashmap API declaring cmpfn_data as const void *, which is what the NEEDSWORK comment was flagging.
I’ll revert my local change, run a build and tests, and then think about safer alternatives (or leave the NEEDSWORK comment in place if changing the hashmap API isn’t appropriate). Thanks for the clarification.