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

Re: [PATCH] Show binary file size change in diff --stat

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 4, 2007, 16:40 UTC
Message-ID
<Pine.LNX.4.64.0704040935350.6730@woody.linux-foundation.org>
In-Reply-To
<Pine.LNX.4.63.0704041819340.4045@wbgn013.biozentrum.uni-wuerzburg.de>
On Wed, 4 Apr 2007, Johannes Schindelin wrote:
> 
> The subtle difference: your approach is _expensive_ in terms of CPU time, 
> while the byte change approach is _dirt cheap_.
Well, you could do a combination (still dirt cheap):
 - show the size before/after (and yes, new/delete should be separate from 
   "zero size before/after")
 - show the size of the binary patch.

No "X added bytes" vs "Y bytes deleted", just "size of binary patch". It could be really small, even if 10k was deleted, or the file was totally re-organized by moving chunks around.

It would still be a meaningful thing to know - if only because it tells you how much space the delta takes. So even if it's a .jpg, and the actual *picture* didn't change a lot (ie you did some new version with color correction or something: it looks similar to the old one, but the *diff* is basically "rewrite it all"), knowing the size of the delta at least has the meaning of "this is how basically much space it will take when you send the binary diff in an email".

That's fairly close to what "5 new lines, 1 deleted line" message means. It's another way to give you an approximate idea of how big the changes were.

		Linus
Previous: Rogan DawesNext: Johannes Schindelin
Message 9 of 12 in “Show binary file size change in diff --stat”
  1. Show binary file size change in diff --statAndy Parkins, Apr 4, 2007
  2. Rogan DawesApr 4, 2007
  3. Geert BoschApr 4, 2007
  4. Rogan DawesApr 4, 2007
  5. Andy ParkinsApr 4, 2007
  6. Rogan DawesApr 4, 2007
  7. Johannes SchindelinApr 4, 2007
  8. Rogan DawesApr 4, 2007
  9. Linus TorvaldsApr 4, 2007
  10. Johannes SchindelinApr 4, 2007
  11. Linus TorvaldsApr 4, 2007
  12. Junio C HamanoApr 4, 2007

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.