Re: Pulling tags from git.git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Ericsson <ae@xxxxxx> writes:

> With the git or git+ssh protocol, tags will be autofollowed
> when you do a pull (only signed tags, I think).  The
> auto-following is done by detecting tags that are fetched,

Ah, you are correct.  We do not follow lightweight tags; I am
not sure if we should.

We detect from ls-remote output if you have objects pointed by
remote tags (either signed or unsigned -- we cannot tell it from
ls-remote output) and fetch those tags that point at what we
have.

The auto following is done only when you are tracking remote
branches, BTW.  Promiscuous fetch for immediate merging does not
follow tags.

Totally untested, so if somebody is interested, please test it,
and if it works, sign it off and bounce it back to me ;-).

-- >8 --
[PATCH] make "git fetch" follow unannotated tags as well.

---
diff --git a/git-fetch.sh b/git-fetch.sh
index 0346d4a..90c8882 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -375,7 +375,7 @@ case "$no_tags$tags" in
 		# using local tracking branch.
 		taglist=$(IFS=" " &&
 		git-ls-remote $upload_pack --tags "$remote" |
-		sed -ne 's|^\([0-9a-f]*\)[ 	]\(refs/tags/.*\)^{}$|\1 \2|p' |
+		sed -e 's/\^{}$//' -e 's/	/ /' |
 		while read sha1 name
 		do
 			test -f "$GIT_DIR/$name" && continue
@@ -386,7 +386,8 @@ case "$no_tags$tags" in
 			git-cat-file -t "$sha1" >/dev/null 2>&1 || continue
 			echo >&2 "Auto-following $name"
 			echo ".${name}:${name}"
-		done)
+		done |
+		sort -u)
 	esac
 	case "$taglist" in
 	'') ;;



-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]