git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff --word-diff problem
@ 2012-01-12  9:05 Ivan Shirokoff
  2012-01-12 11:15 ` [PATCH] word-diff: ignore '\ No newline at eof' marker Thomas Rast
  0 siblings, 1 reply; 3+ messages in thread
From: Ivan Shirokoff @ 2012-01-12  9:05 UTC (permalink / raw)
  To: git

Hello.
I've got a couple of generated files with obfuscated code.
I want to word-diff them just to make sure that everything is right.

The thing is when word-diff gets oneline file without newline at the end 
it compares it with regular line by line diff.

Here is an example. Two one line files generated with perl -e "print 'a 
'x10" > file

git diff --word-diff=plain file1 file2
diff --git a/file1 b/file2
index 3526254..0515a63 100644
--- a/file1
+++ b/file2
@@ -1 +1 @@
[- a a a a a a a a a a-]
  No newline at end of file
  {+a a a a a ab a a a a+}

Git shows that the whole line is different.
And if I add newlines to that files everything works just as expected

git diff --word-diff=plain file1 file2
diff --git a/file1 b/file2
index 1756d83..1ec45b9 100644
--- a/file1
+++ b/file2
@@ -1,2 +1,2 @@
  a a a a a [-a -]{+ab +}a a a a

Is that a bug or I've missed explanation in docs?

-- 
Ivan Shirokoff

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-12 19:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12  9:05 git diff --word-diff problem Ivan Shirokoff
2012-01-12 11:15 ` [PATCH] word-diff: ignore '\ No newline at eof' marker Thomas Rast
2012-01-12 19:23   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).