git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: Karthik Nayak <karthik.188@gmail.com>,  git@vger.kernel.org
Subject: Re: [PATCH 9/9] refs: add a '--required' flag to 'git refs optimize'
Date: Mon, 13 Oct 2025 06:40:38 -0700	[thread overview]
Message-ID: <xmqqwm4y538p.fsf@gitster.g> (raw)
In-Reply-To: <aOjsjpE1vuFUXXbh@pks.im> (Patrick Steinhardt's message of "Fri, 10 Oct 2025 13:22:54 +0200")

Patrick Steinhardt <ps@pks.im> writes:

>>  'git pack-refs' [--all] [--no-prune] [--auto] [--include <pattern>] [--exclude <pattern>]
>> +                [--required]
>
> Hm, I'm not a huge fan of that name. "--dry-run" might be a better name,
> but on the other hand one might expect that such a command also yields
> information about what happens or that the compaction should be
> successful.

I had the same reaction.   First I thought this would make the
command fail if the requested action cannot be done, as it is
required to fulfill the request, or something, but anything user
asks to do is by default required in a sane world, so it does not
make much sense.

If I understand the motivation behind this correctly, we want a
cheap check similar to what is implicitly used before auto-gc kicks
in (i.e., asking "do we have enough loose objects that makes us
worried" without actually counting all the loose objects but
estimating the number cheaply), but "--dry-run", while being much
better than "--required" to convey the intention, has an extra
connotation that it does a much more thorough job than mere
estimating---doing almost the same thing as the real job but without
leaving any lasting effect on the data---which makes the word
inappropriate, too.

Perhaps "--check-" followed by a word specific to what we are trying
to achieve (e.g., if we are trying to see if auto-compaction is
necessary, "--check-for-auto" "check for auto compaction")?  I
dunno.


  parent reply	other threads:[~2025-10-13 13:40 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-10 10:27 [PATCH 0/9] refs: add a '--required' flag to 'git refs optimize' Karthik Nayak
2025-10-10 10:27 ` [PATCH 1/9] refs: move to using the '.optimize' functions Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  8:18     ` Karthik Nayak
2025-10-10 10:27 ` [PATCH 2/9] refs: cleanup code around optimization Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  8:22     ` Karthik Nayak
2025-10-10 10:27 ` [PATCH 3/9] refs: rename 'pack_refs_opts' to 'optimize_refs_opts' Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  8:52     ` Karthik Nayak
2025-10-10 10:27 ` [PATCH 4/9] t/pack-refs-tests: move the 'test_done' to callees Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  8:54     ` Karthik Nayak
2025-10-10 10:27 ` [PATCH 5/9] t/t0450: split whitespace consistency check per subcommand Karthik Nayak
2025-10-10 10:27 ` [PATCH 6/9] reftable/stack: return stack segments directly Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  9:01     ` Karthik Nayak
2025-10-13 11:10       ` Patrick Steinhardt
2025-10-10 10:27 ` [PATCH 7/9] reftable/stack: add function to check if optimization is required Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  9:04     ` Karthik Nayak
2025-10-10 10:27 ` [PATCH 8/9] refs: add a `optimize_required` field to `struct ref_storage_be` Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13  9:46     ` Karthik Nayak
2025-10-10 10:27 ` [PATCH 9/9] refs: add a '--required' flag to 'git refs optimize' Karthik Nayak
2025-10-10 11:22   ` Patrick Steinhardt
2025-10-13 12:37     ` Karthik Nayak
2025-10-13 13:40     ` Junio C Hamano [this message]
2025-10-13 14:37       ` Junio C Hamano
2025-10-14 15:08         ` Karthik Nayak
2025-10-14 17:46           ` Junio C Hamano
2025-10-15  7:50             ` Srivastava, Nitin
2025-10-15  8:19             ` Karthik Nayak
2025-10-15  9:29               ` Karthik Nayak
2025-10-15 12:14                 ` Patrick Steinhardt
2025-10-15 20:17                   ` Junio C Hamano

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=xmqqwm4y538p.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=karthik.188@gmail.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;
as well as URLs for NNTP newsgroup(s).