threads / patch / 17303

patchgit-describe documentation: --match pattern is glob

Subject: [PATCH] git-describe documentation: --match pattern is glob

## tl;dr

One message between Jan 22, 2009 and Jan 22, 2009. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

ecashin@coraid.com· Jan 22, 2009, 16:21 UTC · lore

I finally took a few minutes to figure out what kind of pattern specification the "--match" option to git-describe expects. I think it would be helpful to mention it explicitly in the manpage so that trial and error isn't the only recourse for git-describe users.

It seemed a bit weird to use "torvalds@g5" in the examples, but I guess it's good to be consistent.

commit 0cbed245ca2812cb7708d9d97a8b5092a8b22b73
Author: Ed L. Cashin <ecashin@coraid.com>
Date:   Thu Jan 22 11:09:22 2009 -0500
    mention what kind of pattern the --match option expects
    
    It wasn't clear whether the --match option expects a regular
    expression or some other kind of pattern specification.
Show changes to Documentation/git-describe.txt +17 −1
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index a99b4ef..92a7995 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -73,7 +73,8 @@ OPTIONS
 
 --match <pattern>::
 	Only consider tags matching the given pattern (can be used to avoid
-	leaking private tags made from the repository).
+	leaking private tags made from the repository).  The pattern
+	syntax is similar to shell globbing.
 
 --always::
 	Show uniquely abbreviated commit object as fallback.
@@ -117,6 +118,21 @@ closest tagname without any suffix:
 	[torvalds@g5 git]$ git describe --abbrev=0 v1.0.5^2
 	tags/v1.0.0
 
+When multiple trees are being tracked, --match can specify which tags
+are interesting.  I see that a certain commit appeared first in a
+linux-next release, because I am tracking the linux-next tree as a
+remote:
+
+	[torvalds@g5 linux-2.6]$ git describe --contains 9514dff9
+	next-20080623~13^2~72
+
+But since I really want to know the first mainline release containing
+the commit, I use --match to get those results:
+
+	[torvalds@g5 linux-2.6]$ git describe --contains --match 'v*' 9514dff9
+	v2.6.27-rc1~1103^2~85
+
+
 SEARCH STRATEGY
 ---------------
 

← back to recent threads