Re: [PATCH] xdiff: re-diff shifted change groups when using histogram algorithm
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 30, 2026, 05:43 UTC
- Message-ID
- <xmqqsebn8xlk.fsf@gitster.g>
- In-Reply-To
- <CAHTeOx-TLwqbcdGcb2drD4vE6D3M93EPMjcAeTNR+XNTbmTVZg@mail.gmail.com>
Yee Cheng Chin <ychin.git@gmail.com> writes:
Show 6 quoted lines
> Because of that, I'm leaning on keeping the current code structure, > because it *is* indeed a cleanup step to be run after the previous > one. I could still refactor it into a separate function and put it > into the the case #1/#2 if blocks if you think that's cleaner. > > I will also add the above to the test case in v2.
As long as the resulting code is explained (perhaps in the comment and/or with the code structure) well enough so that when read by somebody else in two months, it won't have to invite the same question as I asked in this thread, it would be OK. I do not know offhand if a comment with the current code structure is good enough, or calling the same helper function from two out of three arms of if/else-if cascade would make it even clearer.
I agree that the case you gave is tricky enough that it would be a good idea to add it as a test.
Thanks.