diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2010-04-20 01:31:25 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-04-19 16:34:49 -0700 |
commit | 944163a4bd4cc4c35392147d10020ba57c6d7d87 (patch) | |
tree | aa3627e5ff2a069cc89588c8d7f07d159ff04404 | |
parent | Git 1.7.1-rc2 (diff) | |
download | tgif-944163a4bd4cc4c35392147d10020ba57c6d7d87.tar.xz |
Honor "tagopt = --tags" configuration option
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | Documentation/config.txt | 4 | ||||
-rwxr-xr-x | contrib/examples/git-fetch.sh | 4 | ||||
-rw-r--r-- | remote.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt index 92f851e797..630e7ca0c9 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -1578,7 +1578,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 e44af2c86d..a314273bd5 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 @@ -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); |