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

Re: Using `git tag -l` to get non-matching tags

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 19, 2009, 18:18 UTC
Message-ID
<7v1vjubcpk.fsf@alter.siamese.dyndns.org>
In-Reply-To
<c115fd3c0911190949x2f32d1cbw26f3260f12d43a6e@mail.gmail.com>
Tim Visher <tim.visher@gmail.com> writes:
> I'm trying to use `git tag -l` to get non-matching tags.  I can't find
> anywhere in the documentation describing what is allowed in the tag
> pattern.

As a general guideline, refs are matched using glob not regexp and given to fnmatch(3).

Who are you in your first sentence?

If you are an end user typing from the terminal trying to list tags excluding some, the answer would be "piping to 'grep -v'".

If you are writing a tool that uses git, the tool uses a part of tag namespace for its own use, and the tool is trying to enumerate end-user tags by excluding the ones it uses for its own use, then the answer would be "do not use 'git tag' in Porcelain---use 'git for-each-ref' and filter its output yourself".

Previous: Tim Visher
Message 2 of 2 in “Using `git tag -l` to get non-matching tags”
  1. Tim VisherNov 19, 2009
  2. Junio C HamanoNov 19, 2009

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.