Re: [PATCHv1bis 1/2] git apply: option to ignore whitespace differences

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 2, 2009 at 9:02 PM, Giuseppe
Bilotta<giuseppe.bilotta@xxxxxxxxx> wrote:
> On Thu, Jul 2, 2009 at 8:27 PM, Junio C Hamano<gitster@xxxxxxxxx> wrote:
>>> +/*
>>> + * Returns true if the given lines (buffer + len) match
>>> + * according to the ignore_whitespace setting
>>> + */
>>> +static int lines_match(const char *s1, size_t n1, const char *s2, size_t n2)
>>> +{
>>> +     if (ignore_whitespace)
>>> +             return !memcmp_ignore_whitespace(s1, n1, s2, n2);
>>> +     else
>>> +             return (n1 == n2) && !memcmp(s1, s2, n1);
>>> +}
>>> +
>>
>> I think this still is an abstraction at the wrong level.  For one thing,
>> if ignore-whitespace is set, you do not even need nor want to do the "fix
>> only the ws breakages we are going to fix anyway according to the ws_rule"
>> transformation applied to the preimage.
>
> I've thought some more about this, and you are right. We still want to
> ws fix the postimage, but that's done elsewhere.

Sorry for repying to myself here, but I'm not convinced again. Or to
be more specific: I think this kind of refactoring is totally out of
the scope of this patch. So although I agree with you in priciple, if
you don't mind I'll keep the first two patches simpler and less
invasive. I'll look into the refactoring as a third step.

-- 
Giuseppe "Oblomov" Bilotta
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]