On 09/06/2013 05:27 PM, Andreas Grünbacher wrote:
> Pádraig,
> 
> 2013/9/5 Pádraig Brady <[email protected]>:
>> 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.

Reply via email to