{"thread":{"id":"8764","subject":"[PATCH] gitweb: make search form generate pathinfo-style URLs","startedAt":"2007-06-28T18:57:07Z","lastAt":"2007-07-09T19:03:42Z","messageCount":5,"participants":["Matt McCutchen","Junio C Hamano","Luben Tuikov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"45996","messageId":"1183057027.6108.4.camel@mattlaptop2","threadId":"8764","inReplyTo":null,"subject":"[PATCH] gitweb: make search form generate pathinfo-style URLs","fromName":"Matt McCutchen","fromEmail":"hashproduct@gmail.com","sentAt":"2007-06-28T18:57:07Z","receivedAt":"2007-06-28T18:57:07Z","isPatch":true,"sender":{"key":"matt@mattmccutchen.net","avatar":"https://avatars.githubusercontent.com/u/8885753?v=4"},"body":"The search form generated traditional-style URLs with a \"p=\" parameter\neven when the pathinfo feature was on.  This patch makes it generate\npathinfo-style URLs when appropriate.\n\nSigned-off-by: Matt McCutchen <hashproduct@gmail.com>\n---\n gitweb/gitweb.perl |   12 +++++++++---\n 1 files changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex f36428e..7b0e110 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -2215,12 +2215,18 @@ EOF\n \t\t} else {\n \t\t\t$search_hash = \"HEAD\";\n \t\t}\n+\t\tmy $action = $my_uri;\n+\t\tmy ($use_pathinfo) = gitweb_check_feature('pathinfo');\n+\t\tif ($use_pathinfo) {\n+\t\t\t$action .= \"/$project\";\n+\t\t} else {\n+\t\t\t$cgi->param(\"p\", $project);\n+\t\t}\n \t\t$cgi->param(\"a\", \"search\");\n \t\t$cgi->param(\"h\", $search_hash);\n-\t\t$cgi->param(\"p\", $project);\n-\t\tprint $cgi->startform(-method => \"get\", -action => $my_uri) .\n+\t\tprint $cgi->startform(-method => \"get\", -action => $action) .\n \t\t      \"<div class=\\\"search\\\">\\n\" .\n-\t\t      $cgi->hidden(-name => \"p\") . \"\\n\" .\n+\t\t      (!$use_pathinfo && $cgi->hidden(-name => \"p\") . \"\\n\") .\n \t\t      $cgi->hidden(-name => \"a\") . \"\\n\" .\n \t\t      $cgi->hidden(-name => \"h\") . \"\\n\" .\n \t\t      $cgi->popup_menu(-name => 'st', -default => 'commit',\n-- \n1.5.2.2.552.gc32f\n"},{"id":"46264","messageId":"1183402981.2664.10.camel@mattlaptop2","threadId":"8764","inReplyTo":"1183057027.6108.4.camel@mattlaptop2","subject":"Re: [PATCH] gitweb: make search form generate pathinfo-style URLs","fromName":"Matt McCutchen","fromEmail":"hashproduct@gmail.com","sentAt":"2007-07-02T19:03:01Z","receivedAt":"2007-07-02T19:03:01Z","isPatch":true,"sender":{"key":"matt@mattmccutchen.net","avatar":"https://avatars.githubusercontent.com/u/8885753?v=4"},"body":"On Thu, 2007-06-28 at 14:57 -0400, Matt McCutchen wrote:\n> The search form generated traditional-style URLs with a \"p=\" parameter\n> even when the pathinfo feature was on.  This patch makes it generate\n> pathinfo-style URLs when appropriate.\n\nI sent this patch four days ago but no one has commented or done\nanything about it.  Please clue me in: is this typical, or did I do\nsomething wrong or do I need to do something else?\n\nThanks,\nMatt\n"},{"id":"46294","messageId":"7vfy46wgdg.fsf@assigned-by-dhcp.cox.net","threadId":"8764","inReplyTo":"1183402981.2664.10.camel@mattlaptop2","subject":"Re: [PATCH] gitweb: make search form generate pathinfo-style URLs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-02T23:11:23Z","receivedAt":"2007-07-02T23:11:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matt McCutchen <hashproduct@gmail.com> writes:\n\n> I sent this patch four days ago but no one has commented or done\n> anything about it.  Please clue me in: is this typical, or did I do\n> something wrong or do I need to do something else?\n\nYes, it sometimes happens to patches to some areas.  No, you did\nnot do anything wrong as far as I can see.  Yes, sending this\nkind of reminder out is exactly what is needed.\n\nI have three recent patches from you on gitweb in my patch\nqueue.\n\n  Subject: [PATCH] gitweb: snapshot cleanups & support for offering multiple\n          formats\n  Date: Thu, 28 Jun 2007 14:02:13 -0400\n  Message-ID: <1183053733.6108.0.camel@mattlaptop2>\n\n  Subject: [PATCH] gitweb: make search form generate pathinfo-style URLs\n  Date: Thu, 28 Jun 2007 14:57:07 -0400\n  Message-ID: <1183057027.6108.4.camel@mattlaptop2>\n\n  Subject: [PATCH] gitweb: make \"No commits\" in project list gray, not bold\n          green\n  Date: Thu, 28 Jun 2007 18:15:22 -0400\n  Message-ID: <1183068922.6108.8.camel@mattlaptop2>\n\nThere are people whom I consider \"gitweb folks\", who are more\nfamiliar with, and more importantly who are more interested in,\ngitweb than I am.  Having good \"subsystem people\" makes gitweb a\nlower-priority area to myself, and for these patches it made\neven so that nobody commented on them.\n\nI should have asked Ack/Nack/Comments from gitweb folks much\nearlier, but was a bit too loaded with the day job.  Sorry about\nthat.\n\nSo, gitweb folks, what do you think about these patches?\n"},{"id":"46717","messageId":"7vejjk6i96.fsf@assigned-by-dhcp.cox.net","threadId":"8764","inReplyTo":"1183057027.6108.4.camel@mattlaptop2","subject":"Re: [PATCH] gitweb: make search form generate pathinfo-style URLs","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-07T21:01:09Z","receivedAt":"2007-07-07T21:01:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matt McCutchen <hashproduct@gmail.com> writes:\n\n> The search form generated traditional-style URLs with a \"p=\" parameter\n> even when the pathinfo feature was on.  This patch makes it generate\n> pathinfo-style URLs when appropriate.\n>\n> Signed-off-by: Matt McCutchen <hashproduct@gmail.com>\n> ---\n>  gitweb/gitweb.perl |   12 +++++++++---\n>  1 files changed, 9 insertions(+), 3 deletions(-)\n>\n> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> index f36428e..7b0e110 100755\n> --- a/gitweb/gitweb.perl\n> +++ b/gitweb/gitweb.perl\n> @@ -2215,12 +2215,18 @@ EOF\n>  \t\t} else {\n>  \t\t\t$search_hash = \"HEAD\";\n>  \t\t}\n> +\t\tmy $action = $my_uri;\n> +\t\tmy ($use_pathinfo) = gitweb_check_feature('pathinfo');\n> +\t\tif ($use_pathinfo) {\n> +\t\t\t$action .= \"/$project\";\n> +\t\t} else {\n> +\t\t\t$cgi->param(\"p\", $project);\n> +\t\t}\n>  \t\t$cgi->param(\"a\", \"search\");\n>  \t\t$cgi->param(\"h\", $search_hash);\n> -\t\t$cgi->param(\"p\", $project);\n> -\t\tprint $cgi->startform(-method => \"get\", -action => $my_uri) .\n> +\t\tprint $cgi->startform(-method => \"get\", -action => $action) .\n>  \t\t      \"<div class=\\\"search\\\">\\n\" .\n> -\t\t      $cgi->hidden(-name => \"p\") . \"\\n\" .\n> +\t\t      (!$use_pathinfo && $cgi->hidden(-name => \"p\") . \"\\n\") .\n\nAhhhhh.  (!$use_pathinfo && blah) when $use_pathinfo is true\nevaluates to an empty string, which saves you from protecting\nyourself from undef.  Perhaps clever, but is not terribly nice.\n\nOther than that, the patch looks sane to me.\n"},{"id":"46884","messageId":"272578.10203.qm@web31813.mail.mud.yahoo.com","threadId":"8764","inReplyTo":"7vejjk6i96.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] gitweb: make search form generate pathinfo-style URLs","fromName":"Luben Tuikov","fromEmail":"ltuikov@yahoo.com","sentAt":"2007-07-09T19:03:42Z","receivedAt":"2007-07-09T19:03:42Z","isPatch":true,"sender":{"key":"ltuikov@yahoo.com","avatar":null},"body":"--- Junio C Hamano <gitster@pobox.com> wrote:\n\n> Matt McCutchen <hashproduct@gmail.com> writes:\n> \n> > The search form generated traditional-style URLs with a \"p=\" parameter\n> > even when the pathinfo feature was on.  This patch makes it generate\n> > pathinfo-style URLs when appropriate.\n> >\n> > Signed-off-by: Matt McCutchen <hashproduct@gmail.com>\n> > ---\n> >  gitweb/gitweb.perl |   12 +++++++++---\n> >  1 files changed, 9 insertions(+), 3 deletions(-)\n> >\n> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\n> > index f36428e..7b0e110 100755\n> > --- a/gitweb/gitweb.perl\n> > +++ b/gitweb/gitweb.perl\n> > @@ -2215,12 +2215,18 @@ EOF\n> >  \t\t} else {\n> >  \t\t\t$search_hash = \"HEAD\";\n> >  \t\t}\n> > +\t\tmy $action = $my_uri;\n> > +\t\tmy ($use_pathinfo) = gitweb_check_feature('pathinfo');\n> > +\t\tif ($use_pathinfo) {\n> > +\t\t\t$action .= \"/$project\";\n> > +\t\t} else {\n> > +\t\t\t$cgi->param(\"p\", $project);\n> > +\t\t}\n> >  \t\t$cgi->param(\"a\", \"search\");\n> >  \t\t$cgi->param(\"h\", $search_hash);\n> > -\t\t$cgi->param(\"p\", $project);\n> > -\t\tprint $cgi->startform(-method => \"get\", -action => $my_uri) .\n> > +\t\tprint $cgi->startform(-method => \"get\", -action => $action) .\n> >  \t\t      \"<div class=\\\"search\\\">\\n\" .\n> > -\t\t      $cgi->hidden(-name => \"p\") . \"\\n\" .\n> > +\t\t      (!$use_pathinfo && $cgi->hidden(-name => \"p\") . \"\\n\") .\n> \n> Ahhhhh.  (!$use_pathinfo && blah) when $use_pathinfo is true\n> evaluates to an empty string, which saves you from protecting\n> yourself from undef.  Perhaps clever, but is not terribly nice.\n> \n> Other than that, the patch looks sane to me.\n\nGood catch.\n\n    Luben\n"}]}