diffparser icon indicating copy to clipboard operation
diffparser copied to clipboard

Tortoise diff example used for tests does not follow unified diff format

Open stkent opened this issue 8 years ago • 0 comments

From this documentation, which seems to be the most official source on the unified diff format:

The lines common to both files begin with a space character.

The tortoise.diff file used for tests does not include this space character at the start of common lines. See for example the common empty line in this snippet:

Modified: trunk/test1.txt
===================================================================
--- /trunk/test1.txt    2013-10-23 19:41:56 UTC (rev 46)
+++ /trunk/test1.txt    2013-10-23 19:44:39 UTC (rev 47)
@@ -1,4 +1,5 @@
-test1
-test1
+aösdhasd
+asdasd

-test1
\ No newline at end of file
+sadsad
+asdasd
\ No newline at end of file

The svn.diff file correctly includes this space for all common lines.

So either:

  • Tortoise does follow unified diff format, and the example file lost space characters somehow; or
  • Tortoise does not follow unified diff format, in which case it is somewhat surprising that the UnifiedDiffParser implementation is currently parsing Tortoise diffs correctly.

stkent avatar May 24 '16 15:05 stkent