From: Taylor Blau <me@ttaylorr.com>
To: karthik nayak <karthik.188@gmail.com>
Cc: Patrick Steinhardt <ps@pks.im>, Jeff King <peff@peff.net>,
git@vger.kernel.org, Victoria Dye <vdye@github.com>,
Derrick Stolee <stolee@gmail.com>
Subject: Re: [PATCH] ref-filter: format iteratively with lexicographic refname sorting
Date: Mon, 21 Oct 2024 16:45:06 -0400 [thread overview]
Message-ID: <Zxa9UvRo9HcBM3YW@nand.local> (raw)
In-Reply-To: <CAOLa=ZREg3xuaT6mbM8+Havn3regZDhK45kGy0+Fw8t56c7Mpg@mail.gmail.com>
On Mon, Oct 21, 2024 at 07:36:55AM -0500, karthik nayak wrote:
> > Mh. So we do end up using `refs_for_each_fullref_in_prefixes()`, which
> > may or may not end up collapsing the prefixes. We do sort and dedup the
> > prefixes via `find_longest_prefixes()`, so we don't have to worry about
> > e.g. `git for-each-ref refs/tags refs/heads refs/tags`.
>
> Tangent: This sent me down a rabbit hole, I wonder if we can do better
> with naming, `find_longest_prefixes` calls `find_longest_prefixes_1`,
> The `_1` doesn't help at all with explaining what the function does.
>
> [snip]
This is actually one of the examples I was thinking of when I replied to
you in the other thread. find_longest_prefixes() is the entry-point, and
does a little bit of setup and tear down that is unique.
But the recursion happens within find_longest_prefixes_1(), which does
not want to repeat the same setup and tear down, hence the split. I
still maintain that _1() is a useful convention for differentiating
between the two, but I'm fine to be in the minority there ;-).
Thanks,
Taylor
next prev parent reply other threads:[~2024-10-21 20:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 6:00 [PATCH] ref-filter: format iteratively with lexicographic refname sorting Patrick Steinhardt
2024-10-16 22:11 ` Taylor Blau
2024-10-17 2:48 ` Jeff King
2024-10-17 4:28 ` Patrick Steinhardt
2024-10-21 12:36 ` karthik nayak
2024-10-21 20:45 ` Taylor Blau [this message]
2024-10-17 5:09 ` [PATCH v2] " Patrick Steinhardt
2024-10-17 20:57 ` Taylor Blau
2024-10-21 11:10 ` Toon Claes
2024-10-21 11:33 ` Patrick Steinhardt
2024-10-21 11:33 ` [PATCH v3] " Patrick Steinhardt
2024-10-21 20:46 ` Taylor Blau
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=Zxa9UvRo9HcBM3YW@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
--cc=peff@peff.net \
--cc=ps@pks.im \
--cc=stolee@gmail.com \
--cc=vdye@github.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;
as well as URLs for NNTP newsgroup(s).