From: Junio C Hamano <gitster@pobox.com>
To: "Jakub Narębski" <jnareb@gmail.com>
Cc: git@vger.kernel.org, Richard Braun <rbraun@sceen.net>
Subject: Re: [PATCH] gitweb: fix link to parent diff with pathinfo
Date: Tue, 24 May 2016 11:17:28 -0700 [thread overview]
Message-ID: <xmqq37p75nif.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <1462579902-18907-1-git-send-email-rbraun@sceen.net> (Richard Braun's message of "Sat, 7 May 2016 02:11:42 +0200")
Richard Braun <rbraun@sceen.net> writes:
> Gitweb, when used with PATH_INFO, shows a link to parent diff
> like http://somedomain/somerepo.git/commitdiff/somehash?hp=parenthash.
> That link reports "400 - Invalid hash parameter".
>
> As I understand it, it should instead directly point to the parent diff,
> i.e. turn it into http://somedomain/somerepo.git/commitdiff/parenthash,
> and delete 'hash_parent' element from the %params hash once we used it,
> otherwise the '?hp=parenthash' string is appended.
>
> Signed-off-by: Richard Braun <rbraun@sceen.net>
> ---
Pinging...
> gitweb/gitweb.perl | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index 05d7910..f7f7936 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -1423,7 +1423,12 @@ sub href {
> delete $params{'hash'};
> delete $params{'hash_base'};
> } elsif (defined $params{'hash'}) {
> - $href .= esc_path_info($params{'hash'});
> + if (defined $params{'hash_parent'}) {
> + $href .= esc_path_info($params{'hash_parent'});
> + delete $params{'hash_parent'};
> + } else {
> + $href .= esc_path_info($params{'hash'});
> + }
> delete $params{'hash'};
> }
next prev parent reply other threads:[~2016-05-24 18:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-06 10:19 [PATCH] gitweb: fix link to parent diff with pathinfo Richard Braun
2016-05-06 22:21 ` Junio C Hamano
2016-05-07 0:11 ` Richard Braun
2016-05-24 18:17 ` Junio C Hamano [this message]
2016-05-24 18:26 ` Richard Braun
2016-05-24 18:39 ` Junio C Hamano
2016-05-25 20:33 ` Jakub Narębski
2016-05-25 22:20 ` Richard Braun
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=xmqq37p75nif.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
--cc=rbraun@sceen.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.