From: Ezekiel Newren Date: Tue, 23 Sep 2025 16:50:49 GMT Subject: Re: [PATCH v4 00/12] Cleanup xdfile_t and xrecord_t in xdiff. Message-ID: In-Reply-To: On Tue, Sep 23, 2025 at 8:12 AM Junio C Hamano wrote: > Ezekiel Newren writes: > > > I apologize for my previous phrasing. I was not very tactful. Yes, I > > think your suggestion is a good idea. I'll incorporate that into my > > patches. > > I didn't get an impression that you were _not_ tactful at all. If > the arrangement is like what I outlined in the message you are > responding to, I am perfectly fine if the type of changed[] is an > array of bool. The only thing I found was disturbing was the idea > to assign 2 into a _Bool. Comparing a _Bool, which can be either 0 > oor 1, and find it is different from litral 2 (or MAYBE that is > defined to be 2) is perfectly fine. I'm going to reroll this to make it much easier to see that the enum macros are separate from rchg/changed. After carefully re-reading those 2 functions, I think the macros NONE(0), SOME(1), TOO_MANY(2) make more sense. I think what dis1 and dis2 (which I'll rename to matches1, matches2) was doing is setting a state value based on the question "How many times does this line in file 1 show up in file 2, and vice versa". My guess is that if the line in file 1 doesn't show up in file 2 then it's obviously different. But if the number of matches is greater than some threshold and isn't minimal then TOO_MANY otherwise set it to SOME. So I think dis1, dis2 are meant as "Here is how we deal with the number of matches found in the other file." Is this explanation congruent with the classic diff (myers/minimal)?