Git development
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Add "--dirstat" for some directory statistics
Date: Mon, 11 Feb 2008 13:41:14 -0800 (PST)	[thread overview]
Message-ID: <alpine.LFD.1.00.0802111338270.2920@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LSU.1.00.0802112122300.3870@racer.site>



On Mon, 11 Feb 2008, Johannes Schindelin wrote:
> 
> Certainly you meant 0x0040 for DIRSTAT, n'est-ce pas?

Yeah, yeah.

> Also, are you sure that you do not want to make the minimal percentage 
> configurable, maybe with --dirstat[=<min-percent>]?  I mean, sometimes 
> even 0.01% is worth showing.

Well, maybe, maybe not. But yeah, at least in whole percentages. Here is a 
simple patch to fix that cut-and-past'o and add a configurable (but still 
whole-percentage-point) thing.

		Linus

---
 diff.c |    2 +-
 diff.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/diff.c b/diff.c
index da91bdd..81948e7 100644
--- a/diff.c
+++ b/diff.c
@@ -2273,7 +2273,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 		options->output_format |= DIFF_FORMAT_NUMSTAT;
 	else if (!strcmp(arg, "--shortstat"))
 		options->output_format |= DIFF_FORMAT_SHORTSTAT;
-	else if (!strcmp(arg, "--dirstat"))
+	else if (opt_arg(arg, 'X', "dirstat", &options->dirstat_percent))
 		options->output_format |= DIFF_FORMAT_DIRSTAT;
 	else if (!strcmp(arg, "--check"))
 		options->output_format |= DIFF_FORMAT_CHECKDIFF;
diff --git a/diff.h b/diff.h
index 3181263..9da6601 100644
--- a/diff.h
+++ b/diff.h
@@ -30,7 +30,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,
 #define DIFF_FORMAT_SUMMARY	0x0008
 #define DIFF_FORMAT_PATCH	0x0010
 #define DIFF_FORMAT_SHORTSTAT	0x0020
-#define DIFF_FORMAT_DIRSTAT	0x0020
+#define DIFF_FORMAT_DIRSTAT	0x0040
 
 /* These override all above */
 #define DIFF_FORMAT_NAME	0x0100

  reply	other threads:[~2008-02-11 22:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-11 20:59 Add "--dirstat" for some directory statistics Linus Torvalds
2008-02-11 21:17 ` Linus Torvalds
2008-02-11 21:24 ` Johannes Schindelin
2008-02-11 21:41   ` Linus Torvalds [this message]
2008-02-11 22:06   ` Linus Torvalds
2008-02-11 22:25     ` Linus Torvalds

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=alpine.LFD.1.00.0802111338270.2920@woody.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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