Skip to contentSkip to conversation

describe match pattern for soft tags too

PATCH In review Michael Dressel 4 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 describe match pattern for soft tags too

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(-)
builtin-describe.c +2 -2
index df554b3..a1b8251 100644
@@ -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;
Signature · 1 line
1.5.5.3
#1 lore raw

Hi,

Quoted 2 lines · Michael Dressel

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

#2 lore raw
Quoted 6 lines · Johannes Schindelin
Quoted 2 lines · Michael Dressel

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.

Signature · 1 line
Shawn.
Acked-by on v1 1/1
#3 lore raw
In reply to Michael Dressel
Quoted 4 lines · Michael Dressel

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,

Quoted 22 lines
---
 builtin-describe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
builtin-describe.c +0 -0
index df554b3..a1b8251 100644
@@ -82,10 +82,10 @@ static int get_name(const char *path, const unsigned 

char *sha1, int flag, void

builtin-describe.c +2 -2
 	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;
Signature · 1 line
Shawn.
#4 lore raw
Quoted 7 lines · Shawn O. Pearce
Quoted 4 lines · Michael Dressel

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.

Quoted 5 lines

Signed-off-by tag?

Assuming you supply Junio an SBO tag,

Thanks for proofreading.

#5 lore raw
Quoted 13 lines · Junio C Hamano
Quoted 7 lines · Shawn O. Pearce
Quoted 4 lines · Michael Dressel

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.

Quoted 7 lines
Quoted 5 lines

Signed-off-by tag?

Assuming you supply Junio an SBO tag,

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