# Using `git tag -l` to get non-matching tags

2 messages from 2009-11-19 to 2009-11-19. Participants: Tim Visher, Junio C Hamano.
Thread: https://gitlist.dev/t/21668

## Tim Visher, 2009-11-19 17:49

Subject: Using `git tag -l` to get non-matching tags
Message-ID: <c115fd3c0911190949x2f32d1cbw26f3260f12d43a6e@mail.gmail.com>
URL: https://gitlist.dev/e/c115fd3c0911190949x2f32d1cbw26f3260f12d43a6e%40mail.gmail.com

```
Hello Everyone,

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.  Brief testing leads me to believe that it's only basic bash
like pattern support.

Thoughts?

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

```

## Junio C Hamano, 2009-11-19 18:18

Subject: Re: Using `git tag -l` to get non-matching tags
Message-ID: <7v1vjubcpk.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v1vjubcpk.fsf%40alter.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".

```
