Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Laveesh Bansal <laveeshb@laveeshbansal.com>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Karthik Nayak" <karthik.188@gmail.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: Re: [PATCH] builtin/reflog: expire --all and named refs in one loop
Date: Tue, 10 Nov 2026 08:09:07 +0100	[thread overview]
Message-ID: <avLDE1gGsjjy2ryd@pks.im> (raw)
In-Reply-To: <20261109161313.54630-1-laveeshb@laveeshbansal.com>

On Mon, Nov 09, 2026 at 08:13:13AM -0800, Laveesh Bansal wrote:
> Patrick Steinhardt <ps@pks.im> writes:
> 
> > One thing I wonder though: now that we first gather reflog names, can't
> > we also easily deduplicate them? For example if the same reflog name was
> > given multiple times on the command line, or in case the reflog is
> > included both via a command line argument and via "--all".
> 
> I want this patch to change no behavior, and deduplicating would change
> the output: with "--verbose", a name given twice lists its entries
> twice today, and sorting would reorder them.  It could be done in the
> loop, by skipping a name already seen, but that is a separate change.

You could add it as a second commit to this patch series. Like that, the
refactoring and the change in behaviour would still be separate from one
another. And that second commit would be a good point in case vouching
for why the refactoring is a good idea.

> > Okay, we only apply per-reflog options in the case where the reflog name
> > was explicitly specified by the user, becaues only in that case do we
> > call `repo_dwim_log()`.
> 
> reflog_expire_options_set_refname() is called for every entry in the
> loop, as it was in both loops before, so the per-reflog options apply
> to the --all entries too.  Only repo_dwim_log() is conditional: the
> names from --all come straight from the ref store and need no lookup.
> 
> I'll reword the commit message as you suggest and send a v2 once others
> have had a chance to comment.

Thanks!

Patrick

  reply	other threads:[~2026-11-10  7:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08  1:22 [PATCH] builtin/reflog: expire --all and named refs in one loop Laveesh Bansal
2026-11-09  9:40 ` Patrick Steinhardt
2026-11-09 16:13   ` Laveesh Bansal
2026-11-10  7:09     ` Patrick Steinhardt [this message]
2026-11-09 20:04   ` Junio C Hamano
2026-11-10 15:26 ` [PATCH v2 0/2] builtin/reflog: expire each reflog only once Laveesh Bansal
2026-11-10 15:26   ` [PATCH v2 1/2] builtin/reflog: expire --all and named refs in one loop Laveesh Bansal
2026-11-10 15:26   ` [PATCH v2 2/2] builtin/reflog: expire each reflog only once Laveesh Bansal
2026-11-11 12:42     ` Patrick Steinhardt

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=avLDE1gGsjjy2ryd@pks.im \
    --to=ps@pks.im \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=karthik.188@gmail.com \
    --cc=laveeshb@laveeshbansal.com \
    /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