# [PATCH] remotes.not-origin.tagopt

2 messages from 2007-02-15 to 2007-02-15. Participants: Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/6830

## Junio C Hamano, 2007-02-15 09:46

Subject: [PATCH] remotes.not-origin.tagopt
Message-ID: <7vfy97g3d8.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vfy97g3d8.fsf%40assigned-by-dhcp.cox.net

```
With a configuration entry like this:

	[remote "alt-git"]
        	url = git://repo.or.cz/alt.git/git/
                fetch = +refs/heads/*:refs/remotes/alt-git/*
                tagopt = --no-tags

you do not have to say "git pull --no-tags alt-git".  Just
saying "git pull alt-git" would suffice.

Obviously, if you want to get the tag from such an alternate
remote in a separate namespace, you could also do something like:

	[remote "alt-git"]
        	url = git://repo.or.cz/alt.git/git/
                fetch = +refs/heads/*:refs/remotes/alt-git/*
                fetch = +refs/tags/*:refs/remote-tags/alt-git/*
                tagopt = --no-tags

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 git-fetch.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/git-fetch.sh b/git-fetch.sh
index ca984e7..d230995 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -243,6 +243,15 @@ then
 	orig_head=$(git-rev-parse --verify HEAD 2>/dev/null)
 fi
 
+# Allow --notags from remote.$1.tagopt
+case "$tags$no_tags" in
+'')
+	case "$(git-config --get "remote.$1.tagopt")" in
+	--no-tags)
+		no_tags=t ;;
+	esac
+esac
+
 # If --tags (and later --heads or --all) is specified, then we are
 # not talking about defaults stored in Pull: line of remotes or
 # branches file, and just fetch those and refspecs explicitly given.

```

## Johannes Schindelin, 2007-02-15 10:46

Subject: Re: [PATCH] remotes.not-origin.tagopt
Message-ID: <Pine.LNX.4.63.0702151055591.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702151055591.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <7vfy97g3d8.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Thu, 15 Feb 2007, Junio C Hamano wrote:

> With a configuration entry like this:
> 
> 	[remote "alt-git"]
>         	url = git://repo.or.cz/alt.git/git/
>                 fetch = +refs/heads/*:refs/remotes/alt-git/*
>                 tagopt = --no-tags

How about going the full nine yards, and call it "fetchopt"? Then we would 
not check for the tag options, but instead parse $fetchopt _after_ "$@" in 
git-fetch.

Ciao,
Dscho

```
