{"thread":{"id":"15307","subject":"[PATCH] Add --filedirstat diff option","startedAt":"2008-09-01T01:12:59Z","lastAt":"2008-09-03T12:47:52Z","messageCount":12,"participants":["Heikki Orsila","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"89352","messageId":"20080901011259.GA31696@zakalwe.fi","threadId":"15307","inReplyTo":null,"subject":"[PATCH] Add --filedirstat diff option","fromName":"Heikki Orsila","fromEmail":"heikki.orsila@iki.fi","sentAt":"2008-09-01T01:12:59Z","receivedAt":"2008-09-01T01:12:59Z","isPatch":true,"sender":{"key":"heikki.orsila@iki.fi","avatar":null},"body":"--filedirstat is the same as --dirstat, but it counts \"damaged files\"\ninstead of \"damaged lines\" (lines that are added or removed).\n\nSigned-off-by: Heikki Orsila <heikki.orsila@iki.fi>\n---\nExample of Linux v2.6.25..v2.6.26:\n\n$ git diff --filedirstat v2.6.25..v2.6.26 \n   3.3% arch/arm/\n   6.0% arch/powerpc/\n   3.8% arch/x86/\n  12.1% arch/\n   3.4% drivers/media/video/\n   6.8% drivers/net/\n  26.5% drivers/\n   6.4% fs/\n   4.5% include/linux/\n  13.0% include/\n   5.9% net/\n\n$ git diff --dirstat v2.6.25..v2.6.26 \n   4.9% arch/arm/\n   9.0% arch/powerpc/configs/\n  14.6% arch/\n   5.0% drivers/media/video/\n   4.2% drivers/media/\n   5.5% drivers/net/sk98lin/\n   6.6% drivers/net/wireless/\n   5.7% drivers/net/\n   4.8% drivers/s390/net/\n  17.8% drivers/\n   6.4% include/\n   5.1% net/\n\n\n Documentation/diff-options.txt |    3 +++\n diff.c                         |   11 +++++++++--\n diff.h                         |    1 +\n 3 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 1759386..6e84f40 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -66,6 +66,9 @@ endif::git-format-patch[]\n \tthe \"--cumulative\" flag, which adds up percentages recursively\n \teven when they have been already reported for a sub-directory.\n \n+--filedirstat[=limit]::\n+\tSame as --dirstat, but count changed files instead of lines.\n+\n --summary::\n \tOutput a condensed summary of extended header information\n \tsuch as creations, renames and mode changes.\ndiff --git a/diff.c b/diff.c\nindex 135dec4..48f33d6 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1110,9 +1110,13 @@ static void show_dirstat(struct diff_options *options)\n \t\t/*\n \t\t * Original minus copied is the removed material,\n \t\t * added is the new material.  They are both damages\n-\t\t * made to the preimage.\n+\t\t * made to the preimage. In --filedirstat mode, count\n+\t\t * damaged files, not damaged lines. This is done by\n+\t\t * counting only a single damaged line per file.\n \t\t */\n \t\tdamage = (p->one->size - copied) + added;\n+\t\tif (options->filedirstat && damage > 0)\n+\t\t\tdamage = 1;\n \n \t\tALLOC_GROW(dir.files, dir.nr + 1, dir.alloc);\n \t\tdir.files[dir.nr].name = name;\n@@ -2474,7 +2478,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n \t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n \telse if (!strcmp(arg, \"--cumulative\"))\n \t\toptions->output_format |= DIFF_FORMAT_CUMULATIVE;\n-\telse if (!strcmp(arg, \"--check\"))\n+\telse if (opt_arg(arg, 'X', \"filedirstat\", &options->dirstat_percent)) {\n+\t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n+\t\toptions->filedirstat = 1;\n+\t} else if (!strcmp(arg, \"--check\"))\n \t\toptions->output_format |= DIFF_FORMAT_CHECKDIFF;\n \telse if (!strcmp(arg, \"--summary\"))\n \t\toptions->output_format |= DIFF_FORMAT_SUMMARY;\ndiff --git a/diff.h b/diff.h\nindex 50fb5dd..2832bb8 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -86,6 +86,7 @@ struct diff_options {\n \tint rename_limit;\n \tint warn_on_too_large_rename;\n \tint dirstat_percent;\n+\tint filedirstat;\n \tint setup;\n \tint abbrev;\n \tconst char *prefix;\n-- \n1.6.0.1\n"},{"id":"89485","messageId":"7vd4jnnifp.fsf@gitster.siamese.dyndns.org","threadId":"15307","inReplyTo":"20080901011259.GA31696@zakalwe.fi","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-02T06:57:46Z","receivedAt":"2008-09-02T06:57:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Heikki Orsila <heikki.orsila@iki.fi> writes:\n\n> @@ -2474,7 +2478,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n>  \t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n>  \telse if (!strcmp(arg, \"--cumulative\"))\n>  \t\toptions->output_format |= DIFF_FORMAT_CUMULATIVE;\n> -\telse if (!strcmp(arg, \"--check\"))\n> +\telse if (opt_arg(arg, 'X', \"filedirstat\", &options->dirstat_percent)) {\n> +\t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n> +\t\toptions->filedirstat = 1;\n\nWhy 'X'?  It would never match, confusing to the reader, and risks a\nsudden change in behaviour when these statements are reordered or somebody\nmechanically attempts to convert this to parse_options().\n"},{"id":"89500","messageId":"20080902115848.GA1252@jolt.modeemi.cs.tut.fi","threadId":"15307","inReplyTo":"7vd4jnnifp.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Heikki Orsila","fromEmail":"shd@modeemi.fi","sentAt":"2008-09-02T11:58:49Z","receivedAt":"2008-09-02T11:58:49Z","isPatch":true,"sender":{"key":"shd@modeemi.fi","avatar":null},"body":"On Mon, Sep 01, 2008 at 11:57:46PM -0700, Junio C Hamano wrote:\n> Heikki Orsila <heikki.orsila@iki.fi> writes:\n> \n> > @@ -2474,7 +2478,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n> >  \t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n> >  \telse if (!strcmp(arg, \"--cumulative\"))\n> >  \t\toptions->output_format |= DIFF_FORMAT_CUMULATIVE;\n> > -\telse if (!strcmp(arg, \"--check\"))\n> > +\telse if (opt_arg(arg, 'X', \"filedirstat\", &options->dirstat_percent)) {\n> > +\t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n> > +\t\toptions->filedirstat = 1;\n> \n> Why 'X'?  It would never match, confusing to the reader, and risks a\n> sudden change in behaviour when these statements are reordered or somebody\n> mechanically attempts to convert this to parse_options().\n\nThis is embarrassing.. I just copied the previous \"dirstat\" line.. \n*grin*\n\nAnyway, what about the concept of filedirstat? Is it agreeable?\n\n-- \nHeikki Orsila\nheikki.orsila@iki.fi\nhttp://www.iki.fi/shd\n"},{"id":"89571","messageId":"7vwshuglq1.fsf@gitster.siamese.dyndns.org","threadId":"15307","inReplyTo":"20080902115848.GA1252@jolt.modeemi.cs.tut.fi","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-02T23:40:54Z","receivedAt":"2008-09-02T23:40:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Heikki Orsila <shd@modeemi.fi> writes:\n\n> On Mon, Sep 01, 2008 at 11:57:46PM -0700, Junio C Hamano wrote:\n>> Heikki Orsila <heikki.orsila@iki.fi> writes:\n>> \n>> > @@ -2474,7 +2478,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n>> >  \t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n>> >  \telse if (!strcmp(arg, \"--cumulative\"))\n>> >  \t\toptions->output_format |= DIFF_FORMAT_CUMULATIVE;\n>> > -\telse if (!strcmp(arg, \"--check\"))\n>> > +\telse if (opt_arg(arg, 'X', \"filedirstat\", &options->dirstat_percent)) {\n>> > +\t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n>> > +\t\toptions->filedirstat = 1;\n>> \n>> Why 'X'?  It would never match, confusing to the reader, and risks a\n>> sudden change in behaviour when these statements are reordered or somebody\n>> mechanically attempts to convert this to parse_options().\n>\n> This is embarrassing.. I just copied the previous \"dirstat\" line.. \n> *grin*\n>\n> Anyway, what about the concept of filedirstat? Is it agreeable?\n\nI am neutral.\n\nI do not think the additional code hurts anybody, so I wouldn't say I do\nnot want to have the patch anywhere near my tree, but on the other hand,\npersonally I do not find the feature as interesting or useful as dirstat.\n\nMaybe there are many others who do find this option useful.  I dunno.\n"},{"id":"89576","messageId":"7v3akigl1g.fsf@gitster.siamese.dyndns.org","threadId":"15307","inReplyTo":"7vwshuglq1.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-02T23:55:39Z","receivedAt":"2008-09-02T23:55:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Heikki Orsila <shd@modeemi.fi> writes:\n>\n>> On Mon, Sep 01, 2008 at 11:57:46PM -0700, Junio C Hamano wrote:\n>>> Heikki Orsila <heikki.orsila@iki.fi> writes:\n>>> \n>>> > @@ -2474,7 +2478,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n>>> >  \t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n>>> >  \telse if (!strcmp(arg, \"--cumulative\"))\n>>> >  \t\toptions->output_format |= DIFF_FORMAT_CUMULATIVE;\n>>> > -\telse if (!strcmp(arg, \"--check\"))\n>>> > +\telse if (opt_arg(arg, 'X', \"filedirstat\", &options->dirstat_percent)) {\n>>> > +\t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n>>> > +\t\toptions->filedirstat = 1;\n>>> \n>>> Why 'X'?  It would never match, confusing to the reader, and risks a\n>>> sudden change in behaviour when these statements are reordered or somebody\n>>> mechanically attempts to convert this to parse_options().\n>>\n>> This is embarrassing.. I just copied the previous \"dirstat\" line.. \n>> *grin*\n>>\n>> Anyway, what about the concept of filedirstat? Is it agreeable?\n>\n> I am neutral.\n>\n> I do not think the additional code hurts anybody, so I wouldn't say I do\n> not want to have the patch anywhere near my tree, but on the other hand,\n> personally I do not find the feature as interesting or useful as dirstat.\n>\n> Maybe there are many others who do find this option useful.  I dunno.\n\nWhile I was thinking about potential issues before queuing this, I\nrealized that I forgot to mention one thing.\n\nThe name.\n\n\"filedirstat\" is simply too long to type, and it has a certain \"Huh?\"\nfactor --- is it about file, or is it about directory?\n\nThis option essentially is just the dirstat but with different logic to\ncompute how big the damage is.  Conceptually, the original one gives one\n\"damage point\" to each added or deleted line.\n\n        $ git show --dirstat=<one-point-per-line>\n\nand yours awards one point to each file, whatever the size of the damage\nis.\n\n        $ git show --dirstat=<one-point-per-file>\n\nI cannot come up with a short-and-sweet name for one-point-per-X offhand,\nbut expressing this variant as an option to --dirstat will leave the door\nopen for other people to come up with different system to award damage\npoints.  Perhaps\n\n\t$ git show --dirstat=exclude-typofixes\n\nmight even be not just interesting but useful ;-)\n\nAgain, I mention this not because I want to reject the patch, but because\nI hope other people with better UI taste may come up with an alternative\nbefore I finish handling other patches.\n"},{"id":"89577","messageId":"20080903000827.GB1252@jolt.modeemi.cs.tut.fi","threadId":"15307","inReplyTo":"7v3akigl1g.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Heikki Orsila","fromEmail":"shd@modeemi.fi","sentAt":"2008-09-03T00:08:27Z","receivedAt":"2008-09-03T00:08:27Z","isPatch":true,"sender":{"key":"shd@modeemi.fi","avatar":null},"body":"On Tue, Sep 02, 2008 at 04:55:39PM -0700, Junio C Hamano wrote:\n> realized that I forgot to mention one thing.\n> \n> The name.\n> \n> \"filedirstat\" is simply too long to type, and it has a certain \"Huh?\"\n> factor --- is it about file, or is it about directory?\n> \n> This option essentially is just the dirstat but with different logic to\n> compute how big the damage is.  Conceptually, the original one gives one\n> \"damage point\" to each added or deleted line.\n> \n>         $ git show --dirstat=<one-point-per-line>\n> \n> and yours awards one point to each file, whatever the size of the damage\n> is.\n> \n>         $ git show --dirstat=<one-point-per-file>\n> \n> I cannot come up with a short-and-sweet name for one-point-per-X offhand,\n> but expressing this variant as an option to --dirstat will leave the door\n> open for other people to come up with different system to award damage\n> points.  Perhaps\n> \n> \t$ git show --dirstat=exclude-typofixes\n> \n> might even be not just interesting but useful ;-)\n\nI wouldn't add new semantics for --dirstat=x since it's easy to add \nnew options. We already have --cumulative, so adding options is not \nnew. How about \"--dirstat --filemode\"? It's long, but it is obvious. I \ndon't think length is relevant here. A shorter but obscure syntax would \nbe \"--dirstat2\" :-) \n\n-- \nHeikki Orsila\nheikki.orsila@iki.fi\nhttp://www.iki.fi/shd\n"},{"id":"89578","messageId":"20080903001254.GA12263@coredump.intra.peff.net","threadId":"15307","inReplyTo":"7v3akigl1g.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-09-03T00:12:54Z","receivedAt":"2008-09-03T00:12:54Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 02, 2008 at 04:55:39PM -0700, Junio C Hamano wrote:\n\n> \"filedirstat\" is simply too long to type, and it has a certain \"Huh?\"\n> factor --- is it about file, or is it about directory?\n\nI had the same thought when I saw the original patch...\n\n> This option essentially is just the dirstat but with different logic to\n> compute how big the damage is.  Conceptually, the original one gives one\n> \"damage point\" to each added or deleted line.\n> \n>         $ git show --dirstat=<one-point-per-line>\n\n...and I thought of --dirstat-byfile. So maybe:\n\n  --dirstat=byfile\n\nand\n\n  --dirstat=byline\n\ndefaulting to byline (or by-line if preferred).\n\n-Peff\n"},{"id":"89580","messageId":"20080903001838.GC1252@jolt.modeemi.cs.tut.fi","threadId":"15307","inReplyTo":"20080903001254.GA12263@coredump.intra.peff.net","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Heikki Orsila","fromEmail":"shd@modeemi.fi","sentAt":"2008-09-03T00:18:38Z","receivedAt":"2008-09-03T00:18:38Z","isPatch":true,"sender":{"key":"shd@modeemi.fi","avatar":null},"body":"On Tue, Sep 02, 2008 at 08:12:54PM -0400, Jeff King wrote:\n> ...and I thought of --dirstat-byfile. So maybe:\n\nI like --dirstat-byfile more than --dirstat=byfile as dirstat already \ntakes a cut-off percent parameter.\n\n-- \nHeikki Orsila\nheikki.orsila@iki.fi\nhttp://www.iki.fi/shd\n"},{"id":"89581","messageId":"7vbpz6dqd0.fsf_-_@gitster.siamese.dyndns.org","threadId":"15307","inReplyTo":"20080903000827.GB1252@jolt.modeemi.cs.tut.fi","subject":"Re* [PATCH] Add --filedirstat diff option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-03T00:28:59Z","receivedAt":"2008-09-03T00:28:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Heikki Orsila <shd@modeemi.fi> writes:\n\n> I wouldn't add new semantics for --dirstat=x since it's easy to add \n> new options. We already have --cumulative, so adding options is not \n> new. How about \"--dirstat --filemode\"? It's long, but it is obvious. I \n> don't think length is relevant here. A shorter but obscure syntax would \n> be \"--dirstat2\" :-) \n\nI wouldn't actually buy \"easy to add\" argument.  Following the\neasiest-to-implement path down often result in inconsistent and messy UI.\n\nIOW, I may use that expression from time to time like: \"while it may be\neasy to add another option, that would lead to many options that depend on\nother options, with a messy end result\", in a negative sense.\n\nBut you are right to point out that --cumulative is an option that affects\nhow --dirstat operates.  And I think the option parsing of that code is\nbuggy.  It should imply --dirstat, shouldn't it?\n\nSo I do not mind --filemode or whatever option that is expressed as a\nword on the command line separate from --dirstat, but we really should\nconsider this and --cumulative conceptually a sub-option to --dirstat.\n\nHere is a sample patch to fix --cumulative (but of course it is untested);\nI think your --filemode (or whatever its final name is) should hook into\nthe same place as this patch touches, as far as command line parsing is\nconcerned.\n\n-- >8 --\ndiff --cumulative is a sub-option of --dirstat\n\nThe option used to be implemented as if it is a totally independent one,\nbut \"git diff --cumulative\" would not mean anything without \"--dirstat\".\n\nThis makes --cumulative imply --dirstat.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n diff.c |    9 ++++++---\n diff.h |    2 +-\n 2 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git c/diff.c w/diff.c\nindex 135dec4..cbd151b 100644\n--- c/diff.c\n+++ w/diff.c\n@@ -1078,7 +1078,7 @@ static void show_dirstat(struct diff_options *options)\n \tdir.alloc = 0;\n \tdir.nr = 0;\n \tdir.percent = options->dirstat_percent;\n-\tdir.cumulative = options->output_format & DIFF_FORMAT_CUMULATIVE;\n+\tdir.cumulative = DIFF_OPT_TST(options, DIRSTAT_CUMULATIVE);\n \n \tchanged = 0;\n \tfor (i = 0; i < q->nr; i++) {\n@@ -2300,6 +2300,7 @@ void diff_setup(struct diff_options *options)\n \toptions->break_opt = -1;\n \toptions->rename_limit = -1;\n \toptions->dirstat_percent = 3;\n+\tDIFF_OPT_CLR(options, DIRSTAT_CUMULATIVE);\n \toptions->context = 3;\n \n \toptions->change = diff_change;\n@@ -2472,8 +2473,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n \t\toptions->output_format |= DIFF_FORMAT_SHORTSTAT;\n \telse if (opt_arg(arg, 'X', \"dirstat\", &options->dirstat_percent))\n \t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n-\telse if (!strcmp(arg, \"--cumulative\"))\n-\t\toptions->output_format |= DIFF_FORMAT_CUMULATIVE;\n+\telse if (!strcmp(arg, \"--cumulative\")) {\n+\t\toptions->output_format |= DIFF_FORMAT_DIRSTAT;\n+\t\tDIFF_OPT_SET(options, DIRSTAT_CUMULATIVE);\n+\t}\n \telse if (!strcmp(arg, \"--check\"))\n \t\toptions->output_format |= DIFF_FORMAT_CHECKDIFF;\n \telse if (!strcmp(arg, \"--summary\"))\ndiff --git c/diff.h w/diff.h\nindex 50fb5dd..7f53beb 100644\n--- c/diff.h\n+++ w/diff.h\n@@ -31,7 +31,6 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,\n #define DIFF_FORMAT_PATCH\t0x0010\n #define DIFF_FORMAT_SHORTSTAT\t0x0020\n #define DIFF_FORMAT_DIRSTAT\t0x0040\n-#define DIFF_FORMAT_CUMULATIVE\t0x0080\n \n /* These override all above */\n #define DIFF_FORMAT_NAME\t0x0100\n@@ -64,6 +63,7 @@ typedef void (*diff_format_fn_t)(struct diff_queue_struct *q,\n #define DIFF_OPT_CHECK_FAILED        (1 << 16)\n #define DIFF_OPT_RELATIVE_NAME       (1 << 17)\n #define DIFF_OPT_IGNORE_SUBMODULES   (1 << 18)\n+#define DIFF_OPT_DIRSTAT_CUMULATIVE  (1 << 19)\n #define DIFF_OPT_TST(opts, flag)    ((opts)->flags & DIFF_OPT_##flag)\n #define DIFF_OPT_SET(opts, flag)    ((opts)->flags |= DIFF_OPT_##flag)\n #define DIFF_OPT_CLR(opts, flag)    ((opts)->flags &= ~DIFF_OPT_##flag)\n"},{"id":"89584","messageId":"20080903003916.GD1252@jolt.modeemi.cs.tut.fi","threadId":"15307","inReplyTo":"7vbpz6dqd0.fsf_-_@gitster.siamese.dyndns.org","subject":"Re: Re* [PATCH] Add --filedirstat diff option","fromName":"Heikki Orsila","fromEmail":"shd@modeemi.fi","sentAt":"2008-09-03T00:39:17Z","receivedAt":"2008-09-03T00:39:17Z","isPatch":true,"sender":{"key":"shd@modeemi.fi","avatar":null},"body":"On Tue, Sep 02, 2008 at 05:28:59PM -0700, Junio C Hamano wrote:\n> But you are right to point out that --cumulative is an option that affects\n> how --dirstat operates.  And I think the option parsing of that code is\n> buggy.  It should imply --dirstat, shouldn't it?\n\nYes.\n\n> Here is a sample patch to fix --cumulative (but of course it is untested);\n> I think your --filemode (or whatever its final name is) should hook into\n> the same place as this patch touches, as far as command line parsing is\n> concerned.\n\nI'll prepare something later today..\n\n-- \nHeikki Orsila\nheikki.orsila@iki.fi\nhttp://www.iki.fi/shd\n"},{"id":"89585","messageId":"7v7i9udpmg.fsf@gitster.siamese.dyndns.org","threadId":"15307","inReplyTo":"20080903001254.GA12263@coredump.intra.peff.net","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-09-03T00:44:55Z","receivedAt":"2008-09-03T00:44:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Sep 02, 2008 at 04:55:39PM -0700, Junio C Hamano wrote:\n>\n>> \"filedirstat\" is simply too long to type, and it has a certain \"Huh?\"\n>> factor --- is it about file, or is it about directory?\n>\n> I had the same thought when I saw the original patch...\n>\n>> This option essentially is just the dirstat but with different logic to\n>> compute how big the damage is.  Conceptually, the original one gives one\n>> \"damage point\" to each added or deleted line.\n>> \n>>         $ git show --dirstat=<one-point-per-line>\n>\n> ...and I thought of --dirstat-byfile. So maybe:\n>\n>   --dirstat=byfile\n>\n> and\n>\n>   --dirstat=byline\n>\n> defaulting to byline (or by-line if preferred).\n\nAs Heikki points out (and I missed this initially myself), --dirstat[=x]\nalready exists and it gives the cut-off-point.\n\nPerhaps \"--dirstat-by-file\" that implies \"--dirstat\" (with the\nunderstanding (and documentation) that \"--dirstat\" is a shorthand for\n\"--dirstat-by-line\" that does not exist)?\n"},{"id":"89623","messageId":"20080903124752.GA12936@coredump.intra.peff.net","threadId":"15307","inReplyTo":"7v7i9udpmg.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add --filedirstat diff option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-09-03T12:47:52Z","receivedAt":"2008-09-03T12:47:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 02, 2008 at 05:44:55PM -0700, Junio C Hamano wrote:\n\n> Perhaps \"--dirstat-by-file\" that implies \"--dirstat\" (with the\n> understanding (and documentation) that \"--dirstat\" is a shorthand for\n> \"--dirstat-by-line\" that does not exist)?\n\nMakes sense to me.\n\n-Peff\n"}]}