Re: [PATCH v3 11/19] dir.c: use a single struct exclude_list per source of excludes

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

 



On Sun, Jan 06, 2013 at 10:53:11PM +0000, Adam Spiers wrote:
> That's a valid point.  However, the ary[0] part which assumes external
> knowledge of the internal implementation can trivially be avoided by
> squashing this patch onto the commit we are discussing:

[snipped]

> diff --git a/builtin/ls-files.c b/builtin/ls-files.c
> index 0ca9d8e..0406adc 100644
> --- a/builtin/ls-files.c
> +++ b/builtin/ls-files.c
> @@ -420,10 +420,11 @@ static int option_parse_z(const struct option *opt,
>  static int option_parse_exclude(const struct option *opt,
>  				const char *arg, int unset)
>  {
> -	struct exclude_list_group *group = opt->value;
> +	struct string_list *exclude_list = opt->value;
>  
>  	exc_given = 1;
> -	add_exclude(arg, "", 0, &group->el[0]);
> +	string_list_append(exclude_list, arg);
> +	fprintf(stderr, "append %s\n", arg);

Whoops :-)

[snipped]

> @@ -524,9 +527,13 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix)
>  	if (read_cache() < 0)
>  		die("index file corrupt");
>  
> -	add_exclude_list(&dir, EXC_CMDL);
>  	argc = parse_options(argc, argv, prefix, builtin_ls_files_options,
>  			ls_files_usage, 0);
> +	el = add_exclude_list(&dir, EXC_CMDL);
> +	for (i = 0; i < exclude_list.nr; i++) {
> +		fprintf(stderr, "adding exclude: %s\n", exclude_list.items[i].string);

Excluding those two fprintf() calls, of course :-)

I've removed them, and pushed to my github fork a new version of v4
with the fixed version of this patch inserted in the appropriate place
(and labelled with a "[SQUASH]" prefix):

    git://github.com/aspiers/git.git
    https://github.com/aspiers/git/commits/check-ignore

Since I sent v4 earlier today, to avoid spamming this list, I won't
resend the whole series yet - not until we have made some progress in
reviewing v4.
--
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]