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

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

From
Chris Jerdonek <chris.jerdonek@gmail.com>
Date
Apr 11, 2021, 01:24 UTC
Message-ID
<CAOTb1wef2w_H4mwMMwR4En8665GduAMoceL45+OYC4DSBPtozQ@mail.gmail.com>

Hi, I noticed that git-show-ref only seems to permit matching patterns from the end of a ref name: https://git-scm.com/docs/git-show-ref#Documentation/git-show-ref.txt-ltpatterngt82308203 For example, "git show-ref master" will include both "refs/heads/master" and "refs/remotes/origin/master".

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?

It seems like that would be natural and useful e.g. for repos with many refs and/or repos with namespaces. Am I missing something, or would that be a useful addition?

Thanks, --Chris

Next: brian m. carlson
Message 1 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.