{"thread":{"id":"27233","subject":"Possible bug with --word-diff=porcelain","startedAt":"2011-05-01T20:00:20Z","lastAt":"2011-05-01T20:00:20Z","messageCount":1,"participants":["Eli Barzilay"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"166821","messageId":"19901.48084.941695.439684@winooski.ccs.neu.edu","threadId":"27233","inReplyTo":null,"subject":"Possible bug with --word-diff=porcelain","fromName":"Eli Barzilay","fromEmail":"eli@barzilay.org","sentAt":"2011-05-01T20:00:20Z","receivedAt":"2011-05-01T20:00:20Z","isPatch":false,"sender":{"key":"eli@barzilay.org","avatar":"https://avatars.githubusercontent.com/u/185905?v=4"},"body":"It looks like there are cases where a newline is omitted in the output\nof --word-diff=porcelain:\n\n  $ cat A\n  A foo B\n  zzzzzzzz\n  C\n  $ cat B\n  A bar B\n  C\n  $ git diff --word-diff=porcelain A B\n  diff --git a/A b/B\n  index dfadf3e..3e2f1ba 100644\n  --- a/A\n  +++ b/B\n  @@ -1,3 +1,2 @@\n   A \n  -foo\n  +bar\n    B                        /// right\n  -zzzzzzzz                  \\\\\\ here\n  ~\n   C\n  ~\n\nI'd expect the output to be\n\n  --- a/A\n  +++ b/B\n  @@ -1,3 +1,2 @@\n   A \n  -foo\n  +bar\n    B\n  ~\n  -zzzzzzzz\n  ~\n   C\n  ~\n\nActually it looks like the problem is not just in the porcelain\noutput: I see it with other formats too, like the plain one:\n\n  diff --git a/A b/B\n  index dfadf3e..3e2f1ba 100644\n  --- a/A\n  +++ b/B\n  @@ -1,3 +1,2 @@\n  A [-foo-]{+bar+} B[-zzzzzzzz-]\n  C\n\nand with --word-diff=color:\n\n   diff --git a/A b/B\n   index dfadf3e..3e2f1ba 100644\n   --- a/A\n   +++ b/B\n   @@ -1,3 +1,2 @@\n   A foobar Bzzzzzzzz\n   C\n\n(where the colors are correct, but the newline is missing)\n\n-- \n          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:\n                    http://barzilay.org/                   Maze is Life!\n"}]}