git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: James Bowes <jbowes@dangerouslyinc.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] gc: use parse_options
Date: Thu, 01 Nov 2007 17:49:25 -0700	[thread overview]
Message-ID: <7vhck579pm.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <20071102002856.GB3282@crux.yyz.redhat.com> (James Bowes's message of "Thu, 1 Nov 2007 20:28:57 -0400")

James Bowes <jbowes@dangerouslyinc.com> 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.

  reply	other threads:[~2007-11-02  0:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-02  0:28 [PATCH] gc: use parse_options James Bowes
2007-11-02  0:49 ` Junio C Hamano [this message]
2007-11-02  1:02   ` James Bowes
2007-11-02  8:32   ` Pierre Habouzit
2007-11-05 23:08   ` Brandon Casey
2007-11-06  0:37     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vhck579pm.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jbowes@dangerouslyinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).