gitdiffbinstat - git diff --shortstat -like output for changes in binary files

3 messages, 2 authors, 2016-06-15 · open the first message on its own page

gitdiffbinstat - git diff --shortstat -like output for changes in binary files

From: Matthias Krüger <hidden>
Date: 2016-06-15 22:56:34

I use git mostly for game-development which means I have to deal with a 
lot of binary files (images, sound files etc).

When I came to a point where I had run image optimization on a branch, I 
wanted to know of course how much smaller the new branch was in 
comparison to master.
Problem was that 'git diff --stat' would only summerize per-binary-file 
size changes and 'git diff --shortstat' did skip the binary files entirely.

To solve this problem, I wrote a script ("gitdiffbinstat") which 
basically runs 'git diff --stat' and summerizes the output.

The script can be found here: 
https://github.com/matthiaskrgr/gitdiffbinstat/blob/master/gitdiffbinstat.sh
Screenshot of example output is attached.

I wondered what you guys thought about the script, is there a chance to 
perhaps get it included as some kind of helper script into the official 
git repo?


Regards, Matthias

Re: gitdiffbinstat - git diff --shortstat -like output for changes in binary files

From: Jeff King <hidden>
Date: 2016-06-15 22:56:34

On Fri, Mar 29, 2013 at 07:07:32PM +0100, Matthias Krüger wrote:
I use git mostly for game-development which means I have to deal with
a lot of binary files (images, sound files etc).

When I came to a point where I had run image optimization on a
branch, I wanted to know of course how much smaller the new branch
was in comparison to master.
Problem was that 'git diff --stat' would only summerize
per-binary-file size changes and 'git diff --shortstat' did skip the
binary files entirely.
Have you tried "--summary"? Combined with --stat (or --shortstat) I
wonder if it would get you closer to what you want.

-Peff

Re: gitdiffbinstat - git diff --shortstat -like output for changes in binary files

From: Matthias Krüger <hidden>
Date: 2016-06-15 22:56:34

On 03/29/2013 07:49 PM, Jeff King wrote:
On Fri, Mar 29, 2013 at 07:07:32PM +0100, Matthias Krüger wrote:
quoted
I use git mostly for game-development which means I have to deal with
a lot of binary files (images, sound files etc).

When I came to a point where I had run image optimization on a
branch, I wanted to know of course how much smaller the new branch
was in comparison to master.
Problem was that 'git diff --stat' would only summerize
per-binary-file size changes and 'git diff --shortstat' did skip the
binary files entirely.
Have you tried "--summary"? Combined with --stat (or --shortstat) I
wonder if it would get you closer to what you want.

-Peff
No it doesnt.
It appears to append stuff like

  delete mode 100644 sound/music/NewTutorialStage.ogg
  delete mode 100644 src/pngfuncs.c
  delete mode 100644 src/pngfuncs.h
  delete mode 100644 src/widgets/widget_text_list.c
  delete mode 100644 src/widgets/widget_text_list.h

to the stat but does not summarize the binary file size changes.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help