Re: [PATCH] Fix "apply --reverse" with regard to whitespace

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

 



Hi,

On Sun, 8 Jul 2007, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@xxxxxx> writes:
> 
> > "git apply" used to take check the whitespace in the wrong
> > direction.
> >
> > Noticed by Daniel Barkalow.
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
> > ---
> >
> > 	On Fri, 6 Jul 2007, Daniel Barkalow wrote:
> >
> > 	> If you apply in reverse a patch which adds junk (e.g., terminal
> > 	> whitespace), it complains about the junk you're adding, even 
> > 	> though (since it's in reverse) you're actually removing that 
> > 	> junk.
> >
> > 	This fixes it.
> 
> Hmm.  Does this cover the "trailing blank lines removal" as
> well?

-- snip --
diff --git a/TODO b/TODO
index ecd2b85..8935376 100644
--- a/TODO
+++ b/TODO
@@ -1,6 +1,5 @@
+interdiff between commits
 diff with file/symlink
-remote remove <nick>
-libification: setjmp() error handler with xmalloc(), xcalloc(), xfree() handling
 fix diff_filepair() mess in diff.c
 merge -s rebase
 build in ls-remote
diff --git a/t/t4116-apply-reverse.sh b/t/t4116-apply-reverse.sh
index 9ae2b3a..f3f9181 100755
--- a/t/t4116-apply-reverse.sh
+++ b/t/t4116-apply-reverse.sh
@@ -84,6 +84,7 @@ test_expect_success 'apply in reverse without postimage' '
 
 test_expect_success 'reversing a whitespace introduction' '
 	sed "s/a/a /" < file1 > file1.new &&
+	echo >> file1.new &&
 	mv file1.new file1 &&
 	git diff | git apply --reverse --whitespace=error
 '
-- snap --

Apparently.

Or not.  Since a patch adding empty lines does not trigger any error with 
--whitespace=error.  I just tested that.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux