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

Re: [PATCH] name-rev: introduce the --ref-filter=<regex> option

From
Jeff King <peff@peff.net>
Date
Feb 17, 2007, 14:59 UTC
Message-ID
<20070217145921.GA16747@coredump.intra.peff.net>
In-Reply-To
<Pine.LNX.4.63.0702171502040.22628@wbgn013.biozentrum.uni-wuerzburg.de>
On Sat, Feb 17, 2007 at 03:02:36PM +0100, Johannes Schindelin wrote:
Show 10 quoted lines
> > Instead of (or, in addition to) --tags, to use only tags for naming,
> > you can now use --ref-filter=<regex> to specify which refs are
> > used for naming.
> > 
> > Example:
> > 
> > 	$ git name-rev --ref-filter='/v1' 33db5f4d
> > 	33db5f4d tags/v1.0rc1^0~1593
> 
> Likes, dislikes?

It's a neat idea, but I wonder if you could make it even more flexible by simply accepting a list of possible refs, and then you could filter using grep, or your own more complex selection algorithm. Unfortunately, --stdin is already taken, but something like:

git show-ref | grep tags/v1.4 | git name-rev --stdin-refs 33db5f4d

If the stdin ref format includes both the refname and the hash, you could even find 'fake' refs that don't exist in git (e.g., that you get from a foreign SCM; though why you wouldn't just make git tags for them, I don't know).

Or maybe this is just making the problem too complex, and nobody really wants to do it. I certainly don't have a use at this point, but if you're going to do ref filtering, it seems like making it as general as (painlessly) possible is useful.

-Peff
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 9 of 22 in “finding earliest tags descended from a given commit”
  1. J. Bruce FieldsJan 27, 2007
  2. Shawn O. PearceJan 27, 2007
  3. Linus TorvaldsJan 27, 2007
  4. J. Bruce FieldsJan 27, 2007
  5. Shawn O. PearceJan 27, 2007
  6. Junio C HamanoJan 27, 2007
  7. name-rev: introduce the --ref-filter=<regex> optionJohannes Schindelin, Jan 27, 2007
  8. Johannes SchindelinFeb 17, 2007
  9. Jeff KingFeb 17, 2007
  10. Johannes SchindelinFeb 17, 2007
  11. Junio C HamanoFeb 17, 2007
  12. git-name-rev: accept list of refs from userJeff King, Feb 17, 2007
  13. Jeff KingFeb 17, 2007
  14. Junio C HamanoFeb 17, 2007
  15. Jeff KingFeb 17, 2007
  16. Johannes SchindelinFeb 18, 2007
  17. Junio C HamanoFeb 17, 2007
  18. Johannes SchindelinFeb 17, 2007
  19. name-rev: introduce the --ref-filter=<pattern> optionJohannes Schindelin, Feb 17, 2007
  20. Junio C HamanoFeb 17, 2007
  21. Johannes SchindelinFeb 17, 2007
  22. Junio C HamanoFeb 17, 2007

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.