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

Spurious line insertion/deletion stats for binary file

From
Kevin Ballard <kevin@sb.org>
Date
Oct 12, 2010, 22:47 UTC
Message-ID
<8CFCE61F-591A-4B56-B701-D1A391FBB088@sb.org>
I just noticed something fairly odd when making a commit that changed a single binary file:
kevin> (develop +=)> git ci -m 'Replace binary file'
[develop c0c3b98] Replace binary file
 1 files changed, 8 insertions(+), 14 deletions(-)
 rewrite Resources/some_image.png (99%)
The commit results seem to be treating the binary file as text in order to give me insertion/deletion stats. This is quite obviously wrong. For this situation, a fairly simple solution would be to change that line to something like
 1 files changed, 2652 bytes removed
but the correct behavior is a bit less obvious when there are multiple files changed. Does anyone have a good suggestion for how to handle this case?
-Kevin Ballard
Next: Neal Kreitzinger
Message 1 of 2 in “Spurious line insertion/deletion stats for binary file”
  1. Kevin BallardOct 12, 2010
  2. Neal KreitzingerOct 15, 2010

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.