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

Re: branch versioning

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 4, 2010, 14:10 UTC
Message-ID
<20101004141031.GA8349@do>
In-Reply-To
<4CA9DA38.3070103@drmicha.warpmail.net>
On Mon, Oct 04, 2010 at 03:44:24PM +0200, Michael J Gruber wrote:
> That way my branch namespace is reasonably clean, and the graph view on
> github, e.g., is somewhat meaningful. My tag name space is a bit crowded...

This might help you. I don't know. I think the idea is good, but you may need a negative pattern, or multiple patterns... Just a starting point.

If I git-branch supported pattern matching and negative pattern, then my "attic/" hidden namespace would be solved. Hmm..

>From 461bd140c71fc242470c08523bc7becefb9aa2cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= <pclouds@gmail.com>
Date: Mon, 4 Oct 2010 21:05:54 +0700
Subject: [PATCH] tag: add core.taglist to let user customize "git tag -l"
Be default "git tag" alone (or "git tag -l") will list all tags.
Let user specify how they want to list in this case via core.taglist
---
 Documentation/git-tag.txt |    3 ++-
 builtin/tag.c             |    7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-tag.txt b/Documentation/git-tag.txt
index 31c78a8..770d1d8 100644
--- a/Documentation/git-tag.txt
+++ b/Documentation/git-tag.txt
@@ -69,7 +69,8 @@ OPTIONS
 
 -l <pattern>::
 	List tags with names that match the given pattern (or all if no pattern is given).
-	Typing "git tag" without arguments, also lists all tags.
+	Typing "git tag" without arguments, also lists all tags matched
+	by core.taglist ('*' if undefined)
 
 --contains <commit>::
 	Only list tags which contain the specified commit.
diff --git a/builtin/tag.c b/builtin/tag.c
index d311491..33620f6 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -22,6 +22,7 @@ static const char * const git_tag_usage[] = {
 };
 
 static char signingkey[1000];
+static const char *default_pattern = "*";
 
 struct tag_filter {
 	const char *pattern;
@@ -96,7 +97,7 @@ static int list_tags(const char *pattern, int lines,
 	struct tag_filter filter;
 
 	if (pattern == NULL)
-		pattern = "*";
+		pattern = default_pattern;
 
 	filter.pattern = pattern;
 	filter.lines = lines;
@@ -234,6 +235,10 @@ static int git_tag_config(const char *var, const char *value, void *cb)
 		set_signingkey(value);
 		return 0;
 	}
+	if (!strcmp(var, "core.taglist")) {
+		git_config_string(&default_pattern, var, value);
+		return 0;
+	}
 
 	return git_default_config(var, value, cb);
 }
-- 
1.7.0.2.445.gcbdb3
-- 
Duy
Previous: Michael J GruberNext: Tomas Carnecky
Message 7 of 8 in “branch versioning”
  1. Nguyen Thai Ngoc DuyOct 4, 2010
  2. Matthieu MoyOct 4, 2010
  3. Ævar Arnfjörð BjarmasonOct 4, 2010
  4. Nguyen Thai Ngoc DuyOct 4, 2010
  5. Ævar Arnfjörð BjarmasonOct 4, 2010
  6. Michael J GruberOct 4, 2010
  7. Nguyen Thai Ngoc DuyOct 4, 2010
  8. Tomas CarneckyOct 4, 2010

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.