git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mårten Kongstad" <marten.kongstad@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>, git@vger.kernel.org
Cc: "Torsten Bögershausen" <tboegi@web.de>,
	gitster@pobox.com, johan@herland.net, marten.kongstad@gmail.com
Subject: Re: [PATCH v2] diff --shortstat --dirstat: remove duplicate output
Date: Sun, 1 Mar 2015 17:01:25 +0100	[thread overview]
Message-ID: <20150301160125.GB5307@laptop> (raw)
In-Reply-To: <54F320E9.1000006@drmicha.warpmail.net>

On Sun, Mar 01, 2015 at 03:23:37PM +0100, Michael J Gruber wrote:
[]
> If I would have had to guess from the documentation: What does "git diff
> --dirstat --shortstat" do? I would have answered: It displays both the
> dirstat and the shortstat.
> 
> So, is what you are trying to "fix" a peculiarity of
> "--dirstat=changes", or do you simplify prefer --dirstat and --shortstat
> to override each other?
> 
> Maybe I'm overlooking something (and that's not a rhetorical
> conditional), but if you specify both options when you want the output
> of only one them, the answer would be the obvious one, not a patch,
> wouldn't it?
> 
> If there is indeed a good reason to change the behavior it should be
> documented.
I interpret the documentation the same way as you do. The problem is
that the dirstat is displayed twice for --dirstat=changes (or
--dirstat=files):

$ git diff --dirstat=changes,10 --shortstat v2.2.0..v2.2.1
 23 files changed, 453 insertions(+), 54 deletions(-)
  33.5% Documentation/RelNotes/
  26.2% t/
  46.6% Documentation/RelNotes/
  16.6% t/

but only once for --dirstat=lines:

$ git diff --dirstat=lines,10 --shortstat v2.2.0..v2.2.1
 23 files changed, 453 insertions(+), 54 deletions(-)
  33.5% Documentation/RelNotes/
  26.2% t/

This behaviour is either a bug, or an inconsistency not immediately apparent to
the user.

The proposed patch will make the 'changes' and 'files' cases behave like
'lines', i.e. output one shortstat and (only) one dirstat:

$ patched-version-of-git diff --dirstat=changes,10 --shortstat v2.2.0..v2.2.1
 23 files changed, 453 insertions(+), 54 deletions(-)
  46.6% Documentation/RelNotes/
  16.6% t/

  reply	other threads:[~2015-03-01 16:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-28 13:19 [PATCH] diff --shortstat --dirstat: remove duplicate output Mårten Kongstad
2015-02-28 14:21 ` Johan Herland
2015-03-01  3:54   ` Junio C Hamano
2015-03-01  7:39     ` [PATCH v2] " Mårten Kongstad
2015-03-01 10:25       ` Torsten Bögershausen
2015-03-01 14:23         ` Michael J Gruber
2015-03-01 16:01           ` Mårten Kongstad [this message]
2015-03-01 16:08             ` Michael J Gruber
2015-03-01 15:58         ` Mårten Kongstad
2015-03-02  1:00           ` SZEDER Gábor
2015-03-02 15:05             ` [PATCH v3] " Mårten Kongstad
2015-03-05 21:38               ` Junio C Hamano
2015-03-04  9:07             ` [PATCH v2] " Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150301160125.GB5307@laptop \
    --to=marten.kongstad@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johan@herland.net \
    --cc=tboegi@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).