[Top][All Lists]

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

[bug-patch] patch >= 2.6 silently ignores hunks

From: Pádraig Brady
Subject: [bug-patch] patch >= 2.6 silently ignores hunks
Date: Thu, 05 Sep 2013 02:00:34 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

I got a bug report recently that applying the attached simple patch
to the attached file, resulted in varying issues on different versions of patch.

> On 09/03/2013 11:02 AM, FUJIWARA Katsunori wrote:
>> With recent coreutils, "patch" command 2.5.9 causes failure of
>> "./bootstrap" as below:
>>   gnulib/gnulib-tool: *** patch file gl/modules/tempname.diff didn't apply 
>> cleanly
>>   gnulib/gnulib-tool: *** Stop.
>>   missing header for unified diff at line 12 of patch
>>   The text leading up to this was:
>>   --------------------------
>>   |
>>   | Files:
>>   | lib/tempname.c
>>   --------------------------
>>   File to patch: EOF
>>   Skip this patch? [y]
>>   1 out of 1 hunk ignored

So the above failure is OK IMHO.
The attached patch is a bit mangled and needs the following
adjustment to apply cleanly:

-@@ -1,2 +1,2 @@
+@@ -1,5 +1,5 @@

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.
Note patch >= 2.6 does warn about fuzz for the first hunk.

So is this a bug in patch?
Why can't it apply the second hunk anyway?


Attachment: tempname
Description: Text document

Attachment: tempname.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]