Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [PATCH] diff: add --ignore-blank-lines option

From: Antoine Pelisse <hidden>
Date: 2016-06-15 22:57:40
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

On Sun, Jun 9, 2013 at 10:07 PM, Junio C Hamano [off-list ref] wrote:
When any ignore blank option is used, there will be lines that
actually has changes (hence should be shown with +/-) but we
deliberately ignore their changes (hence, if they ever appear in the
hunk, they do so as context lines prefixed with SP not +/-).  When
we do so, we show the lines from the postimage in the context.
Don't we actually use preimage (see below) ? I think using pre-image
allows the patch to be applicable to another tree (but ignoring the
space changes).
If we actually hide new blank lines that are in the context, it means
that we won't be able to apply a patch with 2 new blank lines in the 3
line context.

Anyway, I'm starting to think that "show blank lines changes near
other changes" makes sense more and more sense.
By the way I have a patch I *think* is working, but I will check it
another thousand times before sending.

Cheers,
Antoine

$ git diff
diff --git a/x b/x
index e562137..226e35a 100644
--- a/x
+++ b/x
@@ -4,8 +4,9 @@ change
 3
 4
 5
-6
-7
-8
-9
+   6
+7
+change
+  8
+9
 10
$ git diff -w
diff --git a/x b/x
index e562137..226e35a 100644
--- a/x
+++ b/x
@@ -6,6 +6,7 @@ change
 5
 6
 7
+change
 8
 9
 10
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help