git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: branch versioning
Date: Mon, 4 Oct 2010 21:10:31 +0700	[thread overview]
Message-ID: <20101004141031.GA8349@do> (raw)
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

  reply	other threads:[~2010-10-04 14:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-04 13:18 branch versioning Nguyen Thai Ngoc Duy
2010-10-04 13:25 ` Matthieu Moy
2010-10-04 13:29 ` Ævar Arnfjörð Bjarmason
2010-10-04 13:50   ` Nguyen Thai Ngoc Duy
2010-10-04 14:16     ` Ævar Arnfjörð Bjarmason
2010-10-04 13:44 ` Michael J Gruber
2010-10-04 14:10   ` Nguyen Thai Ngoc Duy [this message]
2010-10-04 14:33 ` Tomas Carnecky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101004141031.GA8349@do \
    --to=pclouds@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).