Subject: Re: [PATCH] xdiff: re-diff shifted change groups when using histogram algorithm

From: Junio C Hamano <[email-masked]>
Date: Thu, 29 Jan 2026 21:43:03 -0800

Yee Cheng Chin <[email-masked]> writes:

> 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.