git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Possible bug: identical lines added/removed in git diff

From
GHGabriel Holodak <gthepiper@gmail.com>
Date
Aug 27, 2018, 01:54 UTC
Message-ID
<CAE6=WB_4_PhjfQpubFcYkNKejfDr22s-y0nPQKw5Yd4GVaN4Yw@mail.gmail.com>
I think I'm running into a bug with git diff on v2.18.0. When I diff
the attached files, part of the diff ends up looking like:
...
 STARTCHAR U+00F0
 ENCODING 240
 SWIDTH 500 0
-DWIDTH 8 0
-BBX 7 12 1 0
-BITMAP
-12
-0C
-14
-22
-02
-3E
-42
-42
-82
-84
-84
-78
+DWIDTH 8 0
+BBX 8 12 0 0
+BITMAP
+1B
+0E
+1E
+33
+03
+3F
+63
+63
+C3
+C6
+C6
+7C
 ENDCHAR
 STARTCHAR U+00F1
...
where the "DWIDTH 8 0" and "BITMAP" lines are removed and added,
despite being identical. It only seems to be happening around this
section of the file, for the U+00F0 character. This also seems close
to a minimal reproduction of the issue. If I git add --patch and stage
a few hunks, then the duplicated lines seem to disappear.

Steps to reproduce: git diff --no-index unitera_bold_italic.bdf.old unitera_bold_italic.bdf.new (It also happens inside a repo, this just seemed the easiest way to demonstrate.)

Gabriel Holodak
Next: Stefan Beller
Message 1 of 9 in “Possible bug: identical lines added/removed in git diff”
  1. Gabriel HolodakAug 27, 2018
  2. Stefan BellerAug 27, 2018
  3. Gabriel HolodakAug 30, 2018
  4. Jeff KingAug 30, 2018
  5. Stefan BellerAug 30, 2018
  6. Jeff KingAug 30, 2018
  7. Stefan BellerAug 30, 2018
  8. Johannes SchindelinAug 31, 2018
  9. Stefan BellerSep 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.