git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: fix link to parent diff with pathinfo

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2016, 18:17 UTC
Message-ID
<xmqq37p75nif.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1462579902-18907-1-git-send-email-rbraun@sceen.net>
Richard Braun <rbraun@sceen.net> writes:
Show 11 quoted lines
> 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...
Show 20 quoted lines
>  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'};
>  		}
Previous: Richard BraunNext: Richard Braun
Message 4 of 8 in “gitweb: fix link to parent diff with pathinfo”
  1. gitweb: fix link to parent diff with pathinfoRichard Braun, May 6, 2016
  2. Junio C HamanoMay 6, 2016
  3. gitweb: fix link to parent diff with pathinfoRichard Braun, May 7, 2016
  4. Junio C HamanoMay 24, 2016
  5. Richard BraunMay 24, 2016
  6. Junio C HamanoMay 24, 2016
  7. Jakub NarębskiMay 25, 2016
  8. Richard BraunMay 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.