Thread (42 messages) flat view 42 messages, 3 authors, 2016-06-15

Re: [RFC/PATCH 5/3] Alternative --dirstat implementation, based on diffstat analysis

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:51:02

Possibly related (same subject, not in this thread)

On Tue, Apr 12, 2011 at 3:03 PM, Johan Herland [off-list ref] wrote:
--stat has a special output mode for binary files:

       Documentation/logo.gif      | Bin 0 -> 16335 bytes
Yeah, I think that's the one we introduced exactly to not give crazy
results (ie really big bars of +++/---).

One option might be to just do something like

    if (binary)
       damage /= 52;

and just say that "52 bytes of binary diff counts as one line".

Which is obviously totally crazy and idiotic, but it actually is
roughly what happens when you print out the binary diff (that "52" is
made up, but I think it may be true. I forget what encoding rules we
use, it's in that kind of range).

So it's "true" in some insane made-up sense.

Feel free to pick any number you like instead of "52" that makes some sense.

Because I don't think we have the option to just dismiss the binary
changes entirely, and I don't like the idea of comparing bytes against
lines.

The other option would be to turn lines (of a non-binary diff) into
bytes, and not count lines at all.

                      Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help