[PATCH] git-describe documentation: --match pattern is glob
From: <hidden>
Date: 2016-06-15 22:46:00
Subsystem:
documentation, the rest · Maintainers:
Jonathan Corbet, Linus Torvalds
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 [off-list ref]
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 ---------------