From: Junio C Hamano <gitster@pobox.com>
To: "Mark C. Chu-Carroll" <markchucarroll@fastmail.com>
Cc: git@vger.kernel.org, jltobler@gmail.com, ps@pks.im
Subject: Re: [PATCH v8 1/1] repo: add filtering options to "repo structure"
Date: Wed, 18 Nov 2026 14:28:52 -0800 [thread overview]
Message-ID: <xmqq33sx3haz.fsf@gitster.g> (raw)
In-Reply-To: <20261118203519.2379494-2-markchucarroll@fastmail.com> (Mark C. Chu-Carroll's message of "Wed, 18 Nov 2026 15:35:19 -0500")
"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 "--".
> 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);
prev parent reply other threads:[~2026-11-18 22:28 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-24 16:45 [PATCH 0/1] repo: add filtering options to "repo structure" Mark C. Chu-Carroll
2026-09-24 16:45 ` [PATCH 1/1] " Mark C. Chu-Carroll
2026-09-30 16:28 ` Patrick Steinhardt
2026-10-05 18:52 ` Mark C. Chu-Carroll
2026-10-05 17:40 ` [PATCH v2 0/1] " Mark C. Chu-Carroll
2026-10-05 17:40 ` [PATCH v2 1/1] " Mark C. Chu-Carroll
2026-10-06 5:51 ` Patrick Steinhardt
2026-10-08 15:46 ` Kaartic Sivaraam
2026-10-09 15:49 ` Mark C. Chu-Carroll
2026-10-09 18:09 ` [PATCH v3 0/1] repo: add revision " Mark C. Chu-Carroll
2026-10-09 18:09 ` [PATCH v3 1/1] repo: add " Mark C. Chu-Carroll
2026-10-09 21:24 ` Junio C Hamano
2026-10-10 14:31 ` Mark C. Chu-Carroll
2026-10-10 15:05 ` [PATCH v4 0/1] repo: add revision " Mark C. Chu-Carroll
2026-10-10 15:05 ` [PATCH v4 1/1] repo: add " Mark C. Chu-Carroll
2026-10-13 11:50 ` Patrick Steinhardt
2026-10-13 13:56 ` Mark C. Chu-Carroll
2026-10-13 14:05 ` Patrick Steinhardt
2026-10-13 17:28 ` [PATCH v5 0/1] repo: add revision " Mark C. Chu-Carroll
2026-10-13 17:28 ` [PATCH v5 1/1] repo: add " Mark C. Chu-Carroll
2026-10-14 12:15 ` Patrick Steinhardt
2026-10-15 14:44 ` Mark C. Chu-Carroll
2026-10-15 15:52 ` Patrick Steinhardt
2026-10-15 14:46 ` [PATCH v6 0/1] repo: add revision " Mark C. Chu-Carroll
2026-10-15 14:46 ` [PATCH v6 1/1] repo: add " Mark C. Chu-Carroll
2026-10-15 15:12 ` Kristoffer Haugsbakk
2026-10-15 16:58 ` Mark C. Chu-Carroll
2026-10-15 17:03 ` [PATCH v7 0/1] repo: add revision " Mark C. Chu-Carroll
2026-10-15 17:03 ` [PATCH v7 1/1] repo: add " Mark C. Chu-Carroll
2026-10-17 3:59 ` Junio C Hamano
2026-11-18 19:30 ` Mark C. Chu-Carroll
2026-10-15 17:05 ` [PATCH v7 0/1] repo: add revision " Mark C. Chu-Carroll
2026-10-15 17:05 ` [PATCH v7 1/1] repo: add " Mark C. Chu-Carroll
2026-10-16 5:31 ` [PATCH v7 0/1] repo: add revision " Patrick Steinhardt
2026-10-16 13:31 ` Mark C. Chu-Carroll
2026-10-16 13:31 ` [PATCH v7 1/1] repo: add " Mark C. Chu-Carroll
2026-11-18 20:35 ` [PATCH v8 0/1] repo: add revision " Mark C. Chu-Carroll
2026-11-18 20:35 ` [PATCH v8 1/1] repo: add " Mark C. Chu-Carroll
2026-11-18 22:11 ` Junio C Hamano
2026-11-18 22:28 ` Junio C Hamano [this message]
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=xmqq33sx3haz.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jltobler@gmail.com \
--cc=markchucarroll@fastmail.com \
--cc=ps@pks.im \
/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