From: Junio C Hamano <gitster@pobox.com>
To: "Guillaume Seguin" <guillaume@segu.in>
Cc: pasky@ucw.cz, git@vger.kernel.org
Subject: Re: [PATCH] gitweb : disambiguate heads and tags withs the same name
Date: Tue, 30 Oct 2007 11:19:48 -0700 [thread overview]
Message-ID: <7v3avsmpmj.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <e877c31c0710280612l5d783ab0o50ce00c70b3311db@mail.gmail.com> (Guillaume Seguin's message of "Sun, 28 Oct 2007 14:12:53 +0100")
"Guillaume Seguin" <guillaume@segu.in> 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.
next prev parent reply other threads:[~2007-10-30 18:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-28 13:12 [PATCH] gitweb : disambiguate heads and tags withs the same name Guillaume Seguin
2007-10-30 18:19 ` Junio C Hamano [this message]
2007-11-03 21:40 ` Guillaume Seguin
-- strict thread matches above, loose matches on Subject: below --
2007-12-01 1:45 [PATCH] gitweb: " Jakub Narebski
2007-12-15 14:34 [PATCH 0/3 (resend)] gitweb: Miscelanous fixes Jakub Narebski
2007-12-15 14:40 ` [PATCH] gitweb: disambiguate heads and tags withs the same name Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7v3avsmpmj.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=guillaume@segu.in \
--cc=pasky@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).