{"thread":{"id":"37471","subject":"Trailing whitespace on git diff output.","startedAt":"2014-09-01T17:47:09Z","lastAt":"2014-09-01T18:10:09Z","messageCount":2,"participants":["Adria Farres","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"248701","messageId":"20140901174709.GA23397@vimeitor","threadId":"37471","inReplyTo":null,"subject":"Trailing whitespace on git diff output.","fromName":"Adria Farres","fromEmail":"14farresa@gmail.com","sentAt":"2014-09-01T17:47:09Z","receivedAt":"2014-09-01T17:47:09Z","isPatch":false,"sender":{"key":"14farresa@gmail.com","avatar":null},"body":"Hello,\n\nToday, while redirecting git diff's output to a text file, I noticed git diff\nleaves a trailing whitespace between different deltas of the same file (the line\nthat separates two different deltas). For example, committing a file with the\nfollowing content:\n---\ntest\n\ntest\n---\n\nthen changing it to the following:\n---\ntest\ntest\n\ntest\ntest\n---\n\ncommitting and diffing it, leaves a trailing whitespace on line 8 of the\ndiff output.\n\nIs that expected behavior? I'm using git 2.1.0.\n\nSorry for taking your time,\n\nAdria\n"},{"id":"248702","messageId":"vpq1trv9pq6.fsf@anie.imag.fr","threadId":"37471","inReplyTo":"20140901174709.GA23397@vimeitor","subject":"Re: Trailing whitespace on git diff output.","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-09-01T18:10:09Z","receivedAt":"2014-09-01T18:10:09Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Adria Farres <14farresa@gmail.com> writes:\n\n> Hello,\n>\n> Today, while redirecting git diff's output to a text file, I noticed git diff\n> leaves a trailing whitespace between different deltas of the same file (the line\n> that separates two different deltas). For example, committing a file with the\n> following content:\n> ---\n> test\n>\n> test\n> ---\n>\n> then changing it to the following:\n> ---\n> test\n> test\n>\n> test\n> test\n> ---\n>\n> committing and diffing it, leaves a trailing whitespace on line 8 of the\n> diff output.\n\nThat is (I replaced spaces with _):\n\n--- a/test.txt\n+++ b/test.txt\n@@ -1,3 +1,5 @@\n_test\n+test\n_\n_test\n+test\n\nGNU diff does the same, and that is what I would expect: the first\ncolumn is left for + and -, and spaces are used as a prefix for the\ncontext.\n\nIf you diff\n\ntest\nx\ntest\n\nand\n\ntest\ntest\nx\ntest\ntest\n\nyou'd expect a space before the 'x' in the diff output. In your example,\nthere's a space before the empty string, which has the same role as the\n'x' above.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"}]}