[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-patch] patch >= 2.6 silently ignores hunks
From: |
Pádraig Brady |
Subject: |
Re: [bug-patch] patch >= 2.6 silently ignores hunks |
Date: |
Fri, 06 Sep 2013 18:08:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 |
On 09/06/2013 05:27 PM, Andreas Grünbacher wrote:
> Pádraig,
>
> 2013/9/5 Pádraig Brady <address@hidden>:
>> The attached patch is a bit mangled and needs the following
>> adjustment to apply cleanly:
>>
>> -@@ -1,2 +1,2 @@
>> +@@ -1,5 +1,5 @@
>
> that, and it's missing a space in line 9 as well.
I didn't mention that as it's inconsequential
>> So with patch < 2.6, the behavior is OK, as the ignored hunk
>> is diagnosed in messages and exit code.
>>
>> However with patch >= 2.6 the ignored hunk is not diagnosed!
>> This results with default options in silent failures.
>
> Patch doesn't recognize the hunk in this case, it treats everything
> after line 8 of tempname.diff as garbage. The parser either requires
> an explicit file name or a patch header (the --- and +++ lines in
> unified format) followed by a number of valid hunks; everything else
> is treated as "garbage".
Even if it's another hunk in the same file?
> It's not so hard to make patch recognize such hunks again, but
> then it will more easily misinterpret other text as part of a patch --
> it's not so clear that things would improve.
OK I understand the tradeoffs, but in this case
it's very surprising that patch ignores the hunk marker on line 9
> How did you end up with the broken patch? Editing by hand, right?
I didn't do it myself, but I presume it was hand editing.
thanks,
Pádraig.