[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
issue with applying a unified patch of zero line context concerning the
From: |
Guillaume ORIOL |
Subject: |
issue with applying a unified patch of zero line context concerning the first line of a file |
Date: |
Wed, 28 Sep 2016 09:33:05 +0200 |
Hi,
I get an unexpected result when applying a unified patch of zero line
context concerning the first line of a file.
Here is the way I reproduce it:
$ echo -e "B\nC\n" >file.a
$ echo -e "A\nB\nC\n" >file.b
$ diff --unified=0 file.a file.b >file.patch
$ patch --unified file.a file.patch
patching file `file.a'
Patch attempted to create file `file.a', which already exists.
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file.a.rej
However, if I change the number of context lines to 1, I get no error.
Here is the versions I use:
$ diff --version
diff - GNU diffutils version 2.7
$ patch --version
patch 2.5
Copyright 1988 Larry Wall
Copyright 1997 Free Software Foundation, Inc.
[...]
--
Guillaume Oriol
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- issue with applying a unified patch of zero line context concerning the first line of a file,
Guillaume ORIOL <=