Re: [PATCH 2/4 v2] Allow detached form for git diff --stat-name-width and --stat-width.

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

 



Matthieu Moy wrote:

>  diff.c |   14 ++++++++++++++
>  1 files changed, 14 insertions(+), 0 deletions(-)

Just some nitpicks:
 
> +++ b/diff.c
> @@ -3071,6 +3071,7 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
>  	else if (!strcmp(arg, "-s"))
>  		options->output_format |= DIFF_FORMAT_NO_OUTPUT;
>  	else if (!prefixcmp(arg, "--stat")) {
> +		argcount = 1;
>  		char *end;

declaration after statement.

> @@ -3079,8 +3080,20 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
>  
>  		switch (*arg) {
>  		case '-':
> +			if (!strcmp(arg, "-width")) {
> +				if (!av[1])
> +					die("Option `--stat-width' requires a value");
> +				width = strtoul(av[1], &end, 10);
> +				argcount = 2;
> +			}
>  			if (!prefixcmp(arg, "-width="))

Could save an extra string comparison with an "else" here.

[...]
> +				name_width = strtoul(av[1], &end, 10);
> +				argcount = 2;
> +			}				

Whitespace damage: trailing tabs.

How about something like the following?

Jonathan Nieder (1):
  diff: split off a function for --stat-* option parsing

Matthieu Moy (1):
  diff: allow --stat-width n, --stat-name-width n

 diff.c |   80 ++++++++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 53 insertions(+), 27 deletions(-)

--
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]