Re: [PATCH] gitweb: fix link to parent diff with pathinfo
On Wed, May 25, 2016 at 10:33:32PM +0200, Jakub Narębski wrote: > Richard, thanks for finding a problematic thing, but you > need to search more for a true fix. Noted, I'll get back to you soon (hopefully not too late). -- Richard Braun -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] gitweb: fix link to parent diff with pathinfo
On Tue, May 24, 2016 at 11:17:28AM -0700, Junio C Hamano wrote: > Pinging... Hum, see [1]. Tell me if I need to resend. -- Richard Braun Pacte Novation / Novasys Ingénierie [1] http://git.661346.n2.nabble.com/PATCH-gitweb-fix-link-to-parent-diff-with-pathinfo-td7655482.html -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] gitweb: fix link to parent diff with pathinfo
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 --- 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'}; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] gitweb: fix link to parent diff with pathinfo
Signed-off-by: Richard Braun --- 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'}; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html