Re: [RFC/PATCH 5/3] Alternative --dirstat implementation, based on diffstat analysis
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- Apr 12, 2011, 22:12 UTC
- Message-ID
- <BANLkTi=6gV1S+6JtK0GNKW6jhA1RFbYXHw@mail.gmail.com>
- In-Reply-To
- <201104130003.02869.johan@herland.net>
On Tue, Apr 12, 2011 at 3:03 PM, Johan Herland <johan@herland.net> 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