git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] remotes.not-origin.tagopt

From
Junio C Hamano <junkio@cox.net>
Date
Feb 15, 2007, 09:46 UTC
Message-ID
<7vfy97g3d8.fsf@assigned-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.
Next: Johannes Schindelin
Message 1 of 2 in “remotes.not-origin.tagopt”
  1. remotes.not-origin.tagoptJunio C Hamano, Feb 15, 2007
  2. Johannes SchindelinFeb 15, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.