[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-patch] Using wrong filename when adding new file
From: |
Andreas Gruenbacher |
Subject: |
Re: [bug-patch] Using wrong filename when adding new file |
Date: |
Tue, 22 Dec 2009 15:50:05 +0100 |
User-agent: |
KMail/1.12.2 (Linux/2.6.31.5-0.1-desktop; KDE/4.3.1; i686; ; ) |
On Tuesday 22 December 2009 12:18:01 Tim Waugh wrote:
> I reported this at savannah.gnu.org but I'm not sure if that's the
> correct place.
Yes, this list or the bug tracker are both fine.
> With patch-2.6, this sequence of commands give the wrong output:
>
> rm -rf a b
> mkdir a b
> touch a/file
> echo content > b/file.new
> diff -u a/file b/file.new > test.patch
> mkdir c
> cd c
> patch -p1 -i ../test.patch
> ls
>
> Basically, when a unified context diff looks like:
>
> --- a/file
> +++ b/file.new
> @@ -0,0 +1 @@
> +content
>
> and the patch is applied in an empty directory, the filename from the
> '+++' line is used when it should be the filename from the '---' line
> instead. "a/file" is a "better" name than "b/file.new", going by the
> POSIX algorithm.
>
> This behaviour is new in patch-2.6.
I can reproduce, and this indeed looks like a bug introduced in 2.6.
Thanks for debugging and reporting!
Andreas