threads / discuss / 23573

diff without num-stat

Subject: diff without num-stat

## tl;dr

6 messages between Apr 22, 2010 and Apr 23, 2010.

replies: 5people: 3as markdown or json

Eli Barzilay· Apr 22, 2010, 19:02 UTC · lore

`git diff' has a `--numstat' flag, but is there any way to *avoid* the numstat? (I'm using `--stat' but want to void the summary line, and I'd like to avoid piping it to `head'.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Michael J Gruber· Apr 23, 2010, 08:14 UTC · re: Eli Barzilay · lore

Re: diff without num-stat

Eli Barzilay venit, vidit, dixit 22.04.2010 21:02:
> `git diff' has a `--numstat' flag, but is there any way to *avoid* the
> numstat?  (I'm using `--stat' but want to void the summary line, and
> I'd like to avoid piping it to `head'.)
So, what DO you want? Except for the different formatting:
--stat output minus --numstat output == summary line
where "summary line" is something like
5 files changed, 5974 insertions(+), 0 deletions(-)
Do you want to (a)void the numstat or the summary?
Michael
Junio C Hamano· Apr 23, 2010, 09:21 UTC · re: Michael J Gruber · lore

Re: diff without num-stat

Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 14 quoted lines
> Eli Barzilay venit, vidit, dixit 22.04.2010 21:02:
>> `git diff' has a `--numstat' flag, but is there any way to *avoid* the
>> numstat?  (I'm using `--stat' but want to void the summary line, and
>> I'd like to avoid piping it to `head'.)
>
> So, what DO you want? Except for the different formatting:
>
> --stat output minus --numstat output == summary line
>
> where "summary line" is something like
>
> 5 files changed, 5974 insertions(+), 0 deletions(-)
>
> Do you want to (a)void the numstat or the summary?
Summary is "create mode ..." etc. and you can already enable/disable it.

That "N files +M/-N lines in total" is _not_ a summary; it is an integral part of ascii-graphical --stat output, which is supposed to produce output like "git diff -p | diffstat". We won't split it out of --stat without a very good reason, there doesn't seem to be an option to "diffstat" for such a thing, so...

Eli Barzilay· Apr 23, 2010, 17:14 UTC · re: Michael J Gruber · lore

Re: diff without num-stat

On Apr 23, Michael J Gruber wrote:
Show 10 quoted lines
> Eli Barzilay venit, vidit, dixit 22.04.2010 21:02:
> > `git diff' has a `--numstat' flag, but is there any way to *avoid* the
> > numstat?  (I'm using `--stat' but want to void the summary line, and
> > I'd like to avoid piping it to `head'.)
> 
> So, what DO you want?
> [...]
> where "summary line" is something like
> 
> 5 files changed, 5974 insertions(+), 0 deletions(-)
An option that avoids that summary line.
On Apr 23, Junio C Hamano wrote:
> 
> Summary is "create mode ..." etc. and you can already enable/disable it.

Right -- I'm asking about the above numstat summary line, which seems to always be included with `--stat'.

Show 5 quoted lines
> That "N files +M/-N lines in total" is _not_ a summary; it is an
> integral part of ascii-graphical --stat output, which is supposed to
> produce output like "git diff -p | diffstat".  We won't split it out
> of --stat without a very good reason, there doesn't seem to be an
> option to "diffstat" for such a thing, so...

Well, the reason is to have an easy-to-glance-over summary of changes for push notification emails. I didn't realize that the intention of --stat was to be completely compatible with `diffstat'.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
Junio C Hamano· Apr 23, 2010, 17:47 UTC · re: Eli Barzilay · lore

Re: diff without num-stat

Eli Barzilay <eli@barzilay.org> writes:
> Well, the reason is to have an easy-to-glance-over summary of changes
> for push notification emails.  I didn't realize that the intention of
> --stat was to be completely compatible with `diffstat'.
I think you have it somewhat backwards.

Being the same as normal diffstat output that people are familiar with, the output makes it "an easy-to-glance-over summary of changes" whereever it is used, be it in a notification e-mail or from interactive command output.

Eli Barzilay· Apr 23, 2010, 19:45 UTC · re: Junio C Hamano · lore

Re: diff without num-stat

On Apr 23, Junio C Hamano wrote:
Show 13 quoted lines
> Eli Barzilay <eli@barzilay.org> writes:
> 
> > Well, the reason is to have an easy-to-glance-over summary of
> > changes for push notification emails.  I didn't realize that the
> > intention of --stat was to be completely compatible with
> > `diffstat'.
> 
> I think you have it somewhat backwards.
> 
> Being the same as normal diffstat output that people are familiar with,
> the output makes it "an easy-to-glance-over summary of changes" whereever
> it is used, be it in a notification e-mail or from interactive command
> output.

(That's true only if the intended audience of these notifications are people who are familiar with diffstat output.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

← back to recent threads