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

[PATCH 2/2] describe: Exclude --all --match=PATTERN

From
Greg Price <price@mit.edu>
Date
Feb 25, 2013, 05:31 UTC
Message-ID
<20130225053152.GI5688@biohazard-cafe.mit.edu>

Currently when --all is passed, the effect of --match is only to demote non-matching tags to be treated like non-tags. This is puzzling behavior and not consistent with the documentation, especially with the suggested usage of avoiding information leaks. The combination of --all and --match is an oxymoron anyway, so just forbid it.

Signed-off-by: Greg Price <price@mit.edu>
---
This should be applied after the preceding patch; I mistakenly omitted
the '1/2' in its subject line.
 Documentation/git-describe.txt | 3 ++-
 builtin/describe.c             | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-describe.txt b/Documentation/git-describe.txt
index 711040d..fd5d8f2 100644
--- a/Documentation/git-describe.txt
+++ b/Documentation/git-describe.txt
@@ -83,7 +83,8 @@ OPTIONS
 --match <pattern>::
 	Only consider tags matching the given `glob(7)` pattern,
 	excluding the "refs/tags/" prefix.  This can be used to avoid
-	leaking private tags from the repository.
+	leaking private tags from the repository.  This option is
+	incompatible with `--all`.
 
 --always::
 	Show uniquely abbreviated commit object as fallback.
diff --git a/builtin/describe.c b/builtin/describe.c
index 04c185b..90a72af 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -435,6 +435,9 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
 	if (longformat && abbrev == 0)
 		die(_("--long is incompatible with --abbrev=0"));
 
+	if (pattern && all)
+		die(_("--match is incompatible with --all"));
+
 	if (contains) {
 		const char **args = xmalloc((7 + argc) * sizeof(char *));
 		int i = 0;
-- 
1.7.11.3
Next: Junio C Hamano
Message 1 of 6 in “describe: Exclude --all --match=PATTERN”
  1. 2/2 describe: Exclude --all --match=PATTERNGreg Price, Feb 25, 2013
  2. Junio C HamanoFeb 27, 2013
  3. Junio C HamanoFeb 28, 2013
  4. Greg PriceMar 3, 2013
  5. Junio C HamanoMar 3, 2013
  6. Greg PriceMar 3, 2013

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.