From: Junio C Hamano Date: Mon, 19 Dec 2011 19:59:57 +0000 (-0800) Subject: request-pull: do not emit "tag" before the tagname X-Git-Tag: v1.7.9-rc0~37^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f032d66ddb0cc81807be14c6a9052367df6d1cbc;p=git.git request-pull: do not emit "tag" before the tagname The whole point of the recent update to allow "git pull $url $tagname" is so that the integrator does not have to store the (signed) tag that is used to convey authenticity to be recorded in the resulting merge in the local repository's tag namespace. Asking for a merge be made with "git pull $url tag $tagname" defeats it. Note that the request can become ambiguous if the requestor has a branch with the same name as the tag, but that is not a new problem limited to pulling. I wouldn't mind if somebody wants to add disambiguation to the find_matching_ref logic in the script as a separate patch, though. Signed-off-by: Junio C Hamano --- diff --git a/git-request-pull.sh b/git-request-pull.sh index 7b5c777f0..d7ba1178a 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -63,10 +63,8 @@ die "fatal: No commits in common between $base and $head" find_matching_ref=' sub abbr { my $ref = shift; - if ($ref =~ s|refs/heads/||) { + if ($ref =~ s|refs/heads/|| || $ref =~ s|refs/tags/||) { return $ref; - } elsif ($ref =~ s|refs/tags/||) { - return "tag $ref"; } else { return $ref; } diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh index aec842fa3..da25bc2d1 100755 --- a/t/t5150-request-pull.sh +++ b/t/t5150-request-pull.sh @@ -180,7 +180,7 @@ test_expect_success 'request names an appropriate branch' ' read branch }