git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] ref-filter: format iteratively with lexicographic refname sorting

From
Taylor Blau <me@ttaylorr.com>
Date
Oct 21, 2024, 20:45 UTC
Message-ID
<Zxa9UvRo9HcBM3YW@nand.local>
In-Reply-To
<CAOLa=ZREg3xuaT6mbM8+Havn3regZDhK45kGy0+Fw8t56c7Mpg@mail.gmail.com>
On Mon, Oct 21, 2024 at 07:36:55AM -0500, karthik nayak wrote:
Show 10 quoted lines
> > 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

Previous: karthik nayakNext: Patrick Steinhardt
Message 6 of 12 in “ref-filter: format iteratively with lexicographic refname sorting”
  1. ref-filter: format iteratively with lexicographic refname sortingPatrick Steinhardt, Oct 16, 2024
  2. Taylor BlauOct 16, 2024
  3. Jeff KingOct 17, 2024
  4. Patrick SteinhardtOct 17, 2024
  5. karthik nayakOct 21, 2024
  6. Taylor BlauOct 21, 2024
  7. ref-filter: format iteratively with lexicographic refname sortingPatrick Steinhardt, Oct 17, 2024
  8. Taylor BlauOct 17, 2024
  9. Toon ClaesOct 21, 2024
  10. Patrick SteinhardtOct 21, 2024
  11. ref-filter: format iteratively with lexicographic refname sortingPatrick Steinhardt, Oct 21, 2024
  12. Taylor BlauOct 21, 2024

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.