Re: [PATCH] Add --filedirstat diff option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Heikki Orsila <shd@xxxxxxxxxx> writes:
>
>> On Mon, Sep 01, 2008 at 11:57:46PM -0700, Junio C Hamano wrote:
>>> Heikki Orsila <heikki.orsila@xxxxxx> writes:
>>> 
>>> > @@ -2474,7 +2478,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
>>> >  		options->output_format |= DIFF_FORMAT_DIRSTAT;
>>> >  	else if (!strcmp(arg, "--cumulative"))
>>> >  		options->output_format |= DIFF_FORMAT_CUMULATIVE;
>>> > -	else if (!strcmp(arg, "--check"))
>>> > +	else if (opt_arg(arg, 'X', "filedirstat", &options->dirstat_percent)) {
>>> > +		options->output_format |= DIFF_FORMAT_DIRSTAT;
>>> > +		options->filedirstat = 1;
>>> 
>>> Why 'X'?  It would never match, confusing to the reader, and risks a
>>> sudden change in behaviour when these statements are reordered or somebody
>>> mechanically attempts to convert this to parse_options().
>>
>> This is embarrassing.. I just copied the previous "dirstat" line.. 
>> *grin*
>>
>> Anyway, what about the concept of filedirstat? Is it agreeable?
>
> I am neutral.
>
> I do not think the additional code hurts anybody, so I wouldn't say I do
> not want to have the patch anywhere near my tree, but on the other hand,
> personally I do not find the feature as interesting or useful as dirstat.
>
> Maybe there are many others who do find this option useful.  I dunno.

While I was thinking about potential issues before queuing this, I
realized that I forgot to mention one thing.

The name.

"filedirstat" is simply too long to type, and it has a certain "Huh?"
factor --- is it about file, or is it about directory?

This option essentially is just the dirstat but with different logic to
compute how big the damage is.  Conceptually, the original one gives one
"damage point" to each added or deleted line.

        $ git show --dirstat=<one-point-per-line>

and yours awards one point to each file, whatever the size of the damage
is.

        $ git show --dirstat=<one-point-per-file>

I cannot come up with a short-and-sweet name for one-point-per-X offhand,
but expressing this variant as an option to --dirstat will leave the door
open for other people to come up with different system to award damage
points.  Perhaps

	$ git show --dirstat=exclude-typofixes

might even be not just interesting but useful ;-)

Again, I mention this not because I want to reject the patch, but because
I hope other people with better UI taste may come up with an alternative
before I finish handling other patches.



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux