This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Info for the item "does patch.exe work different than other unx patch tools?" (i.e. "hunk 1 out of 3 hunks failed")


May be because of the attatched file the mail before is not delivered..

Here is a temporary link to the attached file:
https://www.dropbox.com/s/7etntr4jukp9t5l/ExamplePatch.zip


2012/11/8 Thomas Höhenleitner <thomas@seerose.net>:
> Hello Ryan,
>
> first I appologize for the wrong hunks-failed info. I did not remeber
> it correctly as I wrote the mail.
>
> *    "3 out of 3 hunks FAILED" is what patch tells exactly in example.
> *    I tried patch with the -l switch without success before.
> *    Also --ignore-all-space I use with diff (what is -w and probably
> implies -b)
> *    now I tried also the switch -a with diff: no difference
>
> I created a small example to play with and added it as zip file to this mail.
>
> Best regards,
>
> Thomas
>
> 2012/11/8 Ryan Johnson <ryan.johnson@cs.utoronto.ca>:
>> On 08/11/2012 5:30 AM, Thomas Höhenleitner wrote:
>>>
>>> Hello,
>>>
>>> using Cygwin patch.exe in a batch file I ran into the problem that
>>> patch failed for some reason ("hunk 1 out of 3 hunks failed"):
>>>
>>> Investigating this issue I found that inserting "unix2dos my.patch"
>>> before applying the patch was my friend!
>>> Being paranoid I tried  "dos2unix my.patch" before applying the patch
>>> - and it was my friend too!
>>
>> I've hit problems trying to apply a dos-like patch to a unix-like file, and
>> vice-versa, but not what you describe. Also, problems with line endings tend
>> to go all-or-nothing: either all hunks fail (all line endings differ), or
>> all succeed in the absence of other conflicts.
>>
>> I almost wonder if the file you edited somehow got inconsistent line endings
>> only for the changed lines; that would imply that the two successful hunks
>> have only insertions and/or deletions, while the failed hunk has actual
>> changes.
>>
>> Hard to say without seeing the files involved, tho. Also, did you try -b/-w
>> with diff, and/or -l with patch?
>>
>> Ryan
>>
>>
>>
>> --
>> Problem reports:       http://cygwin.com/problems.html
>> FAQ:                   http://cygwin.com/faq/
>> Documentation:         http://cygwin.com/docs.html
>> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]