git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC 2/2] exclude-promisor-objects: declare when option is allowed

From
Jeff King <peff@peff.net>
Date
Nov 21, 2018, 16:40 UTC
Message-ID
<20181121164019.GA24621@sigill.intra.peff.net>
In-Reply-To
<931421945c040ba4518d91f7af9f386d0136bd2f.1540256910.git.matvore@google.com>
On Mon, Oct 22, 2018 at 06:13:42PM -0700, Matthew DeVore wrote:
Show 12 quoted lines
> 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
Previous: Junio C HamanoNext: Matthew DeVore
Message 7 of 19 in “[RFC 0/2] explicitly support or not support --exclude-promisor-objects”
  1. Matthew DeVoreOct 23, 2018
  2. 1/2 Documentation/git-log.txt: do not show --exclude-promisor-objectsMatthew DeVore, Oct 23, 2018
  3. 2/2 exclude-promisor-objects: declare when option is allowedMatthew DeVore, Oct 23, 2018
  4. Junio C HamanoOct 23, 2018
  5. Matthew DeVoreOct 23, 2018
  6. Junio C HamanoOct 24, 2018
  7. Jeff KingNov 21, 2018
  8. Matthew DeVoreDec 1, 2018
  9. Jeff KingDec 1, 2018
  10. Matthew DeVoreDec 3, 2018
  11. Jeff KingDec 3, 2018
  12. Matthew DeVoreDec 3, 2018
  13. Junio C HamanoDec 4, 2018
  14. revisions.c: put promisor option in specialized structMatthew DeVore, Dec 3, 2018
  15. Jeff KingDec 3, 2018
  16. Matthew DeVoreDec 3, 2018
  17. Matthew DeVoreOct 23, 2018
  18. Junio C HamanoOct 23, 2018
  19. Matthew DeVoreOct 23, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.