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

Re: [PATCH v8 1/1] repo: add filtering options to "repo structure"

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 18, 2026, 22:28 UTC
Message-ID
<xmqq33sx3haz.fsf@gitster.g>
In-Reply-To
<20261118203519.2379494-2-markchucarroll@fastmail.com>
"Mark C. Chu-Carroll" <markchucarroll@fastmail.com> writes:
> The current implementation of "git repo stucture" provides summary
> information about everything in the repository - all of the
...
> +	argc = parse_options(argc, argv, prefix, options, repo_structure_usage,
> +			     PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT);

Are we willing to lose "--" from the command line? For example, to count only the commits that touch things under the t/ directory between master and grobble:

    git repo stucture master..grobble -- t/

might be useful, but without PARSE_OPT_KEEP_DASHDASH, wouldn't you lose "--"? If there are directories or files that happen to have the same name as an existing revision, the users would need to be able to disambiguate them with "--".

Show 7 quoted lines
>  	if (show_progress < 0)
>  		show_progress = isatty(2);
>  
> +	repo_init_revisions(repo, &revs, prefix);
> +	if (argc > 1) {
> +		argc = setup_revisions(argc, argv, &revs, NULL);
> +		included_revision_args = true;
Things like
    git repo stucture --objects
    git repo stucture --stdin
    git repo stucture --end-of-options

would still count as (argc > 1) and cause setup_revisions() to be called, but we still have not received any positive (or negative) revision to start traversing. Should not included_revision_args be initialized based on revs.rev_input_given or something?

> +		if (argc > 1)
> +			return error(_("unrecognized argument: %s"), argv[1]);

This leaks revs and resources held by it because release_revisions() has not been called on it, which may not matter all that much as we will exit soon.

> +	}
> +
> +	structure_count_references(&stats.refs, &revs, repo, show_progress, !included_revision_args);
>  	structure_count_objects(&stats.objects, &revs, repo, show_progress);
Previous: Junio C Hamano
Message 40 of 40 in “repo: add filtering options to "repo structure"”
  1. 0/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Sep 24, 2026
  2. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Sep 24, 2026
  3. Patrick SteinhardtSep 30, 2026
  4. Mark C. Chu-CarrollOct 5, 2026
  5. 0/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 5, 2026
  6. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 5, 2026
  7. Patrick SteinhardtOct 6, 2026
  8. Kaartic SivaraamOct 8, 2026
  9. Mark C. Chu-CarrollOct 9, 2026
  10. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 9, 2026
  11. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 9, 2026
  12. Junio C HamanoOct 9, 2026
  13. Mark C. Chu-CarrollOct 10, 2026
  14. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 10, 2026
  15. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 10, 2026
  16. Patrick SteinhardtOct 13, 2026
  17. Mark C. Chu-CarrollOct 13, 2026
  18. Patrick SteinhardtOct 13, 2026
  19. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 13, 2026
  20. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 13, 2026
  21. Patrick SteinhardtOct 14, 2026
  22. Mark C. Chu-CarrollOct 15, 2026
  23. Patrick SteinhardtOct 15, 2026
  24. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 15, 2026
  25. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 15, 2026
  26. Kristoffer HaugsbakkOct 15, 2026
  27. Mark C. Chu-CarrollOct 15, 2026
  28. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 15, 2026
  29. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 15, 2026
  30. Junio C HamanoOct 17, 2026
  31. Mark C. Chu-CarrollNov 18, 2026
  32. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 15, 2026
  33. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 15, 2026
  34. Patrick SteinhardtOct 16, 2026
  35. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Oct 16, 2026
  36. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 16, 2026
  37. 0/1 repo: add revision filtering options to "repo structure"Mark C. Chu-Carroll, Nov 18, 2026
  38. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Nov 18, 2026
  39. Junio C HamanoNov 18, 2026
  40. Junio C HamanoNov 18, 2026

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.