Skip to content

Commit

Permalink
Honor "tagopt = --tags" configuration option
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Tardieu authored and Junio C Hamano committed Apr 19, 2010
1 parent 5469e2d commit 944163a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion contrib/examples/git-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 944163a

Please sign in to comment.