git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Tardieu <sam@rfc1149.net>
To: git@vger.kernel.org
Subject: [v3 PATCH 1/2] Honor "tagopt = --tags" configuration option
Date: Tue, 20 Apr 2010 01:31:25 +0200	[thread overview]
Message-ID: <20100419233125.3631.97051.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100419233026.3631.67086.stgit@localhost.localdomain>

If the "tagopt = --tags" option of a remote is set, all tags
will be fetched as in "git fetch --tags".

Signed-off-by: Samuel Tardieu <sam@rfc1149.net>
---
 Documentation/config.txt      |    4 +++-
 contrib/examples/git-fetch.sh |    4 +++-
 remote.c                      |    2 ++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index f45ae9c..8e7fd88 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -1587,7 +1587,9 @@ remote.<name>.uploadpack::
 
 remote.<name>.tagopt::
 	Setting this value to \--no-tags disables automatic tag following when
-	fetching from remote <name>
+	fetching from remote <name>. Setting it to \--tags will fetch every
+	tag from remote <name>, even if they are not reachable from remote
+	branch heads.
 
 remote.<name>.vcs::
 	Setting this to a value <vcs> will cause git to interact with
diff --git a/contrib/examples/git-fetch.sh b/contrib/examples/git-fetch.sh
index e44af2c..a314273 100755
--- a/contrib/examples/git-fetch.sh
+++ b/contrib/examples/git-fetch.sh
@@ -127,10 +127,12 @@ then
 	orig_head=$(git rev-parse --verify HEAD 2>/dev/null)
 fi
 
-# Allow --notags from remote.$1.tagopt
+# Allow --tags/--notags from remote.$1.tagopt
 case "$tags$no_tags" in
 '')
 	case "$(git config --get "remote.$1.tagopt")" in
+	--tags)
+		tags=t ;;
 	--no-tags)
 		no_tags=t ;;
 	esac
diff --git a/remote.c b/remote.c
index c70181c..0f073e0 100644
--- a/remote.c
+++ b/remote.c
@@ -443,6 +443,8 @@ static int handle_config(const char *key, const char *value, void *cb)
 	} else if (!strcmp(subkey, ".tagopt")) {
 		if (!strcmp(value, "--no-tags"))
 			remote->fetch_tags = -1;
+		else if (!strcmp(value, "--tags"))
+			remote->fetch_tags = 2;
 	} else if (!strcmp(subkey, ".proxy")) {
 		return git_config_string((const char **)&remote->http_proxy,
 					 key, value);

  reply	other threads:[~2010-04-19 23:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 23:31 [v3 PATCH 0/2] Add --tags/--no-tags options to "git add remote" Samuel Tardieu
2010-04-19 23:31 ` Samuel Tardieu [this message]
2010-04-19 23:31 ` [v3 PATCH 2/2] remote add: add a --no-tags (-n) option Samuel Tardieu

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=20100419233125.3631.97051.stgit@localhost.localdomain \
    --to=sam@rfc1149.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).