Re: [PATCH] gitweb : disambiguate heads and tags withs the same name

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

 



"Guillaume Seguin" <guillaume@xxxxxxx> writes:

> Avoid wrong disambiguation that would link logs/trees of tags and heads which
> share the same name to the same page, leading to a disambiguation that would
> prefer the tag, thus making it impossible to access the corresponding
> head log and
> tree without hacking the url by hand.
>
> ---
>  gitweb/gitweb.perl |   14 ++++++++------
>  1 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 48e21da..f918c00 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -3534,6 +3534,7 @@ sub git_tags_body {
>  	for (my $i = $from; $i <= $to; $i++) {
>  		my $entry = $taglist->[$i];
>  		my %tag = %$entry;
> +		my $name = "refs/tags/$tag{'name'}";
>  		my $comment = $tag{'subject'};
>  		my $comment_short;
>  		if (defined $comment) {
> @@ -3570,8 +3571,8 @@ sub git_tags_body {
>  		      "<td class=\"link\">" . " | " .
>  		      $cgi->a({-href => href(action=>$tag{'reftype'},
> hash=>$tag{'refid'})}, $tag{'reftype'});
>  		if ($tag{'reftype'} eq "commit") {
> -			print " | " . $cgi->a({-href => href(action=>"shortlog",
> hash=>$tag{'name'})}, "shortlog") .
> -			      " | " . $cgi->a({-href => href(action=>"log",
> hash=>$tag{'name'})}, "log");
> +			print " | " . $cgi->a({-href => href(action=>"shortlog",
> hash=>$name)}, "shortlog") .
> ...

Just in case anybody is wondering, the patch is whitespace
mangled and lacks a sign-off.

I suspect what the patch does may be a good idea, although I
haven't followed the existing code closely to verify it.
-
To unsubscribe from this list: 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]

  Powered by Linux