# [PATCH] describe match pattern for soft tags too

6 messages from 2008-06-03 to 2008-06-04. Participants: Michael Dressel, Johannes Schindelin, Shawn O. Pearce, Junio C Hamano.
Thread: https://gitlist.dev/t/13784

## Michael Dressel, 2008-06-03 17:59

Subject: [PATCH] describe match pattern for soft tags too
Message-ID: <alpine.LNX.1.10.0806031957360.3605@pollux>
URL: https://gitlist.dev/e/alpine.LNX.1.10.0806031957360.3605%40pollux

```

So far git describe --match <pattern> would apply the <pattern> only
to tag objects not to soft tags. This change make describe apply
the <pattern> to soft tags too.
---
  builtin-describe.c |    4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin-describe.c b/builtin-describe.c
index df554b3..a1b8251 100644
--- a/builtin-describe.c
+++ b/builtin-describe.c
@@ -82,10 +82,10 @@ static int get_name(const char *path, const unsigned char *sha1, int flag, void
  	if (might_be_tag) {
  		if (is_tag) {
  			prio = 2;
-			if (pattern && fnmatch(pattern, path + 10, 0))
-				prio = 0;
  		} else
  			prio = 1;
+		if (pattern && fnmatch(pattern, path + 10, 0))
+			prio = 0;
  	}
  	else
  		prio = 0;
-- 
1.5.5.3

```

## Johannes Schindelin, 2008-06-03 20:24

Subject: Re: [PATCH] describe match pattern for soft tags too
Message-ID: <alpine.DEB.1.00.0806032124040.13507@racer.site.net>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0806032124040.13507%40racer.site.net
In-Reply-To: <alpine.LNX.1.10.0806031957360.3605@pollux>

```
Hi,

On Tue, 3 Jun 2008, Michael Dressel wrote:

> So far git describe --match <pattern> would apply the <pattern> only
> to tag objects not to soft tags.

And I thought that was what --tags was for.

Ciao,
Dscho

```

## Shawn O. Pearce, 2008-06-03 22:42

Subject: Re: [PATCH] describe match pattern for soft tags too
Message-ID: <20080603224225.GN12896@spearce.org>
URL: https://gitlist.dev/e/20080603224225.GN12896%40spearce.org
In-Reply-To: <alpine.DEB.1.00.0806032124040.13507@racer.site.net>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> On Tue, 3 Jun 2008, Michael Dressel wrote:
> 
> > So far git describe --match <pattern> would apply the <pattern> only
> > to tag objects not to soft tags.
> 
> And I thought that was what --tags was for.

Yes.  However there is a bug in git-describe's implementation;
--match only tested on annotated tags.  The test was buried inside
of the block that handles the annotated case.  Michael's patch pulls
this test outside where it can apply to lightweight tags when --tags
is included on the command line.

-- 
Shawn.

```

## Shawn O. Pearce, 2008-06-03 22:48

Subject: Re: [PATCH] describe match pattern for soft tags too
Message-ID: <20080603224839.GO12896@spearce.org>
URL: https://gitlist.dev/e/20080603224839.GO12896%40spearce.org
In-Reply-To: <alpine.LNX.1.10.0806031957360.3605@pollux>

```
Michael Dressel <MichaelTiloDressel@t-online.de> wrote:
> 
> So far git describe --match <pattern> would apply the <pattern> only
> to tag objects not to soft tags. This change make describe apply
> the <pattern> to soft tags too.

Whoops.

Signed-off-by tag?

Assuming you supply Junio an SBO tag,

Acked-by: Shawn O. Pearce <spearce@spearce.org>

> ---
>  builtin-describe.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/builtin-describe.c b/builtin-describe.c
> index df554b3..a1b8251 100644
> --- a/builtin-describe.c
> +++ b/builtin-describe.c
> @@ -82,10 +82,10 @@ static int get_name(const char *path, const unsigned 
> char *sha1, int flag, void
>  	if (might_be_tag) {
>  		if (is_tag) {
>  			prio = 2;
> -			if (pattern && fnmatch(pattern, path + 10, 0))
> -				prio = 0;
>  		} else
>  			prio = 1;
> +		if (pattern && fnmatch(pattern, path + 10, 0))
> +			prio = 0;
>  	}
>  	else
>  		prio = 0;

-- 
Shawn.

```

## Junio C Hamano, 2008-06-04 06:04

Subject: Re: [PATCH] describe match pattern for soft tags too
Message-ID: <7vy75lzqew.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy75lzqew.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080603224839.GO12896@spearce.org>

```
"Shawn O. Pearce" <spearce@spearce.org> writes:

> Michael Dressel <MichaelTiloDressel@t-online.de> wrote:
>> 
>> So far git describe --match <pattern> would apply the <pattern> only
>> to tag objects not to soft tags. This change make describe apply
>> the <pattern> to soft tags too.
>
> Whoops.

Micronit.  They are called "lightweight" tags.  There aren't any hard tags
either.

> Signed-off-by tag?
>
> Assuming you supply Junio an SBO tag,
>
> Acked-by: Shawn O. Pearce <spearce@spearce.org>

Thanks for proofreading.

```

## Michael Dressel, 2008-06-04 19:06

Subject: Re: [PATCH] describe match pattern for soft tags too
Message-ID: <alpine.LNX.1.10.0806042104130.3410@pollux>
URL: https://gitlist.dev/e/alpine.LNX.1.10.0806042104130.3410%40pollux
In-Reply-To: <7vy75lzqew.fsf@gitster.siamese.dyndns.org>

```

On Tue, 3 Jun 2008, Junio C Hamano wrote:

> "Shawn O. Pearce" <spearce@spearce.org> writes:
>
>> Michael Dressel <MichaelTiloDressel@t-online.de> wrote:
>>>
>>> So far git describe --match <pattern> would apply the <pattern> only
>>> to tag objects not to soft tags. This change make describe apply
>>> the <pattern> to soft tags too.
>>
>> Whoops.
>
> Micronit.  They are called "lightweight" tags.  There aren't any hard tags
> either.
>
>> Signed-off-by tag?
>>
>> Assuming you supply Junio an SBO tag,
>>
>> Acked-by: Shawn O. Pearce <spearce@spearce.org>
>
> Thanks for proofreading.

Thanks for the comments.
I will sent in a new patch see:

[PATCH] describe: match pattern for lightweight tags too

Cheers,
Michael

```
