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

Re: question re: git show-ref and matching ref patterns from the front

From
Chris Jerdonek <chris.jerdonek@gmail.com>
Date
Apr 11, 2021, 02:09 UTC
Message-ID
<CAOTb1wftqhQSZ8KRyh0hXBE7enM8KG85H-UyxBObnsx8Ff8vvA@mail.gmail.com>
In-Reply-To
<YHJW4xCgw6GN0Rag@camp.crustytoothpaste.net>

On Sat, Apr 10, 2021 at 6:54 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 9 quoted lines
>
> On 2021-04-11 at 01:24:57, Chris Jerdonek wrote:
> > However, is there a way to limit Git to showing refs starting with a
> > prefix, and that doesn't also require Git to iterate over all refs?
>
> I believe you can do this with git for-each-ref.  It accepts prefixes,
> and assuming you don't use a case-insensitive comparison, it will
> restrict itself to iterating over only those prefixes you specify, not
> all refs.

Thanks. One minor difference, though, seems to be that git for-each-ref doesn't support including the HEAD ref, which you can do with git-show-ref by passing ---head.

--Chris
Previous: brian m. carlson
Message 3 of 3 in “question re: git show-ref and matching ref patterns from the front”
  1. Chris JerdonekApr 11, 2021
  2. brian m. carlsonApr 11, 2021
  3. Chris JerdonekApr 11, 2021

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.