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

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

From
Eecashin@coraid.com <ecashin@coraid.com>
Date
Jan 22, 2009, 16:21 UTC
Message-ID
<dfa634dbd8def9e205bbe219217179ca@coraid.com>

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.
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
 ---------------
 
Message 1 of 1 in “git-describe documentation: --match pattern is glob”
  1. git-describe documentation: --match pattern is globecashin@coraid.com, Jan 22, 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.