git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Matthew DeVore <matvore@google.com>
Cc: git@vger.kernel.org, gitster@pobox.com, pclouds@gmail.com,
	jonathantanmy@google.com, jeffhost@microsoft.com,
	matvore@comcast.net
Subject: Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed
Date: Wed, 21 Nov 2018 11:40:19 -0500	[thread overview]
Message-ID: <20181121164019.GA24621@sigill.intra.peff.net> (raw)
In-Reply-To: <931421945c040ba4518d91f7af9f386d0136bd2f.1540256910.git.matvore@google.com>

On Mon, Oct 22, 2018 at 06:13:42PM -0700, Matthew DeVore wrote:

> diff --git a/builtin/prune.c b/builtin/prune.c
> index 41230f8215..11284d0bf3 100644
> --- a/builtin/prune.c
> +++ b/builtin/prune.c
> @@ -120,6 +120,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
>  	save_commit_buffer = 0;
>  	read_replace_refs = 0;
>  	ref_paranoia = 1;
> +	revs.allow_exclude_promisor_objects_opt = 1;
>  	repo_init_revisions(the_repository, &revs, prefix);
>  
>  	argc = parse_options(argc, argv, prefix, options, prune_usage, 0);

I think this line is in the wrong place. The very first thing
repo_init_revisions() will do is memset() the revs struct to all-zeroes,
so it cannot possibly be doing anything.

Normally it would need to go after init_revisions() but before
setup_revisions(), but we don't seem to call the latter at all in
builtin/prune.c. Which makes sense, because you cannot pass options to
influence the reachability traversal. So I don't think we need to care
about this flag at all here.

Speaking of which, would this flag work better as a field in
setup_revision_opt, which is passed to setup_revisions()? The intent
seem to be to influence how we parse command-line arguments, and that's
where other similar flags are (e.g., assume_dashdash).

-Peff

  parent reply	other threads:[~2018-11-21 16:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  1:13 [RFC 0/2] explicitly support or not support --exclude-promisor-objects Matthew DeVore
2018-10-23  1:13 ` [RFC 1/2] Documentation/git-log.txt: do not show --exclude-promisor-objects Matthew DeVore
2018-10-23  1:13 ` [RFC 2/2] exclude-promisor-objects: declare when option is allowed Matthew DeVore
2018-10-23  5:08   ` Junio C Hamano
2018-10-23 17:55     ` Matthew DeVore
2018-10-24  1:31       ` Junio C Hamano
2018-11-21 16:40   ` Jeff King [this message]
2018-12-01  1:32     ` Matthew DeVore
2018-12-01 19:44       ` Jeff King
2018-12-03 19:10         ` Matthew DeVore
2018-12-03 21:15           ` Jeff King
2018-12-03 21:54             ` Matthew DeVore
2018-12-04  2:20             ` Junio C Hamano
2018-12-03 19:23         ` [PATCH] revisions.c: put promisor option in specialized struct Matthew DeVore
2018-12-03 21:24           ` Jeff King
2018-12-03 22:01             ` Matthew DeVore
2018-10-23  1:18 ` [RFC 0/2] explicitly support or not support --exclude-promisor-objects Matthew DeVore
2018-10-23  4:48 ` Junio C Hamano
2018-10-23 17:09   ` Matthew DeVore

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=20181121164019.GA24621@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jeffhost@microsoft.com \
    --cc=jonathantanmy@google.com \
    --cc=matvore@comcast.net \
    --cc=matvore@google.com \
    --cc=pclouds@gmail.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).