Possible bug with --word-diff=porcelain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It looks like there are cases where a newline is omitted in the output
of --word-diff=porcelain:

  $ cat A
  A foo B
  zzzzzzzz
  C
  $ cat B
  A bar B
  C
  $ git diff --word-diff=porcelain A B
  diff --git a/A b/B
  index dfadf3e..3e2f1ba 100644
  --- a/A
  +++ b/B
  @@ -1,3 +1,2 @@
   A 
  -foo
  +bar
    B                        /// right
  -zzzzzzzz                  \\\ here
  ~
   C
  ~

I'd expect the output to be

  --- a/A
  +++ b/B
  @@ -1,3 +1,2 @@
   A 
  -foo
  +bar
    B
  ~
  -zzzzzzzz
  ~
   C
  ~

Actually it looks like the problem is not just in the porcelain
output: I see it with other formats too, like the plain one:

  diff --git a/A b/B
  index dfadf3e..3e2f1ba 100644
  --- a/A
  +++ b/B
  @@ -1,3 +1,2 @@
  A [-foo-]{+bar+} B[-zzzzzzzz-]
  C

and with --word-diff=color:

   diff --git a/A b/B
   index dfadf3e..3e2f1ba 100644
   --- a/A
   +++ b/B
   @@ -1,3 +1,2 @@
   A foobar Bzzzzzzzz
   C

(where the colors are correct, but the newline is missing)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]