Skip to content

Commit

Permalink
request-pull: do not emit "tag" before the tagname
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Dec 19, 2011
1 parent fe46fa9 commit f032d66
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions git-request-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion t/t5150-request-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ test_expect_success 'request names an appropriate branch' '
read branch
} <digest &&
{
test "$branch" = tag--full ||
test "$branch" = full ||
test "$branch" = master ||
test "$branch" = for-upstream
}
Expand Down

0 comments on commit f032d66

Please sign in to comment.