[PATCH 2 of 4] diffstat: mark binary files with Bin in the count column

Brodie Rao dackze at gmail.com
Wed Aug 5 09:09:41 CDT 2009


On Aug 5, 2009, at 7:45 AM, Dirkjan Ochtman wrote:

> On Thu, Jul 30, 2009 at 17:06, Brodie Rao<dackze at gmail.com> wrote:
>> # HG changeset patch
>> # User Brodie Rao <me+hg at dackz.net>
>> # Date 1248966173 14400
>> # Node ID 4e4d554a609b50494411693f6a390ffd711f4501
>> # Parent  4076e49a0bf9555116bf4b6e5bb1fe0d420d4814
>> diffstat: mark binary files with Bin in the count column
>
> Is this what diffstat(1) does, or is this just something you invented?

This is something that Git's diffstat does. Git goes a bit further,  
though: it specifies the file size in the old changeset and the size  
in the new changeset. I'd like to add that information in as well, but  
I wasn't able to think of a clean way to get the old file size from  
patch.diff().

I think having more information than a blank graph line for binary  
files is useful enough to add.

Here's a snippet of Git's output:

  webkit/api/public/WebKitClient.h                   |   63 +-
  webkit/api/src/ChromiumBridge.cpp                  |   72 +-
  webkit/api/src/WebBindings.cpp                     |    2 +-
  webkit/api/src/WebKit.cpp                          |   10 +
  .../canvas/image-pattern-rotate-expected.checksum  |    1 +
  .../fast/canvas/image-pattern-rotate-expected.png  |  Bin 0 -> 5845  
bytes
  .../fast/canvas/image-pattern-rotate-expected.txt  |   41 +
  .../textfield-drag-into-disabled-expected.checksum |    1 -
  .../textfield-drag-into-disabled-expected.png      |  Bin 15741 -> 0  
bytes

Git also truncates really long file names, which I like as well. I  
didn't get around to implementing that, however.


More information about the Mercurial-devel mailing list