Jeff King <p...@peff.net> writes:

>> 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.

"diff" is not about "how much did my project grow or shink".  If you
moved one block of lines up or down in the same file, you will see
double the number of lines moved in the statistics.

On the other hand, the use case to measure how much it helped to run
png optimizers only cares about the total size.

I do not think it is a good match to present the "binary stat" next
to the textual diff stats in the first place.  Adding two numbers do
not give us any meaningful number.

It is an interesting use case, but it just is not a problem core
Git, which is a source code management system, particularly wants to
bolt on a solution for, that does not mesh well with other parts of
the system.

We do want to make sure that people who want to deal with binaries
have access to raw statistics, so that they can build their solution
on top of, though.  "ls-tree -r -l" gives byte-size of each blob,
and the attribute system can let you tell which paths are binaries.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to