Re: [PATCH] gc: use parse_options

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

 



James Bowes <jbowes@xxxxxxxxxxxxxxxxxx> writes:

> +	struct option builtin_gc_options[] = {
> +		OPT_BOOLEAN(0, "prune", &prune, "prune unused objects"),

I would write "unreferenced loose" instead of "unused" here...

> +		OPT_BOOLEAN(0, "aggressive", &aggressive, "be more thorough (increased runtime)"),
> +		OPT_BOOLEAN(0, "auto", &auto_gc, "enable auto-gc mode"),
> +		OPT_END()
> +	};
> +
>  	git_config(gc_config);
>  
>  	if (pack_refs < 0)
>  		pack_refs = !is_bare_repository();
>  
> +	parse_options(argc, argv, builtin_gc_options, builtin_gc_usage, 0);
> +
> +	if (aggressive) {
> +		append_option(argv_repack, "-f", MAX_ADD);
> +		if (aggressive_window > 0) {
> +			sprintf(buf, "--window=%d", aggressive_window);
> +			append_option(argv_repack, buf, MAX_ADD);
>  		}
>  	}
> -	if (i != argc)
> -		usage(builtin_gc_usage);

Now, what makes the command report error when the user says:

	$ git gc unwanted parameter

Other than that, this is a good thing to have, I think.
-
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