git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:05 UTC

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

From
MCMark C. Chu-Carroll <markchucarroll@fastmail.com>
Date
Oct 5, 2026, 18:52 UTC
Message-ID
<DLX4QVXQJTQ4.24JR7ES0P3H@fastmail.com>
In-Reply-To
<ar04uStCZ4pnEJ38@pks.im>
On Wed Sep 30, 2026 at 12:28 PM EDT, Patrick Steinhardt wrote:
Show 41 quoted lines
> On Thu, Sep 24, 2026 at 12:45:03PM -0400, Mark C. Chu-Carroll wrote:
>> "git repo structure" provides a collection of useful information
>> about the information stored in a repo. In particular, it's
>> valuable for diagnosing performance issues caused by large objects
>> stored in a repo.
>> 
>> The current implementation of "git repo stucture" provides summary
>> information about everything in the repository - all of the
>> branches, remotes, tags, stashes, and notes. But sometimes
>> to properly diagnose a problem, it's useful to be able to exclude
>> refs that are known to not be relevant to the issue at hand.
>
> Yes, indeed. Sometimes you may for example want to figure out where
> exactly the storage size of a particular repository is going. Or in the
> case of GitLab for example, we may have bookkeeping references that are
> not controllable by customers. So we may only want to get the structure
> for all the customer-controllable branches there.
>
>> Add a set of flags that allow a user to selective exclude
>> reference types from the report generated by "git repo structure".
>> When a ref type is excluded by the filter, it no longer appears
>> in the report (ie, if "--no-tags" is passed, the report line
>> for "Branches" will no longer appear under "* References").
>> Following the pattern of flags that are only used to
>> disable functionality (eg, "--no-verify" in "builtins/push.c"),
>> only the "--no-<reftype>" syntax is listed in the updated
>> documentation.
>
> Hmm, okay. I would have expected that the user can essentially pass
> arbitrary revisions as understood by git-log(1) et al. And if they pass
> any such revisions, we should not enumerate anything but what they have
> passed, so the flags shouldn't only be used to exclude.
>
> So, for example:
>
>     $ git repo structure --branches
>     $ git repo structure master
>     $ git repo structure --all --not --branches
>
> I would hope that git-repo(1) can achieve that rather easily because I
> expect that it uses `struct rev_info`, but let's read on.

That makes sense. My initial understanding was that most of what "git repo structure" does is internalize the functionality of git-sizer into the core of git. The only filters offered by git-sizer are type-based. But I agree that a commit list based filter is a lot more useful, so I've updated the patch set to implement it.

   -Mark
-- 
Mark Craig Chu-Carroll (@MarkChuCarroll at gitlab)
*** Software Tools/Math Geek - Software Engineer at Gitlab
*** Work Email: mcarroll@gitlab.com / markchucarroll@fastmail.com
*** Personal Blog: http://goodmath.org/blog / Personal email: markcc@gmail.com
Previous: Mark C. Chu-CarrollNext: Patrick Steinhardt
Message 6 of 7 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. 0/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 5, 2026
  5. 1/1 repo: add filtering options to "repo structure"Mark C. Chu-Carroll, Oct 5, 2026
  6. Mark C. Chu-CarrollOct 5, 2026
  7. Patrick SteinhardtOct 6, 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.