* [PATCH] gitweb: make search form generate pathinfo-style URLs
@ 2007-06-28 18:57 Matt McCutchen
2007-07-02 19:03 ` Matt McCutchen
2007-07-07 21:01 ` Junio C Hamano
0 siblings, 2 replies; 5+ messages in thread
From: Matt McCutchen @ 2007-06-28 18:57 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
The search form generated traditional-style URLs with a "p=" parameter
even when the pathinfo feature was on. This patch makes it generate
pathinfo-style URLs when appropriate.
Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
---
gitweb/gitweb.perl | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f36428e..7b0e110 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -2215,12 +2215,18 @@ EOF
} else {
$search_hash = "HEAD";
}
+ my $action = $my_uri;
+ my ($use_pathinfo) = gitweb_check_feature('pathinfo');
+ if ($use_pathinfo) {
+ $action .= "/$project";
+ } else {
+ $cgi->param("p", $project);
+ }
$cgi->param("a", "search");
$cgi->param("h", $search_hash);
- $cgi->param("p", $project);
- print $cgi->startform(-method => "get", -action => $my_uri) .
+ print $cgi->startform(-method => "get", -action => $action) .
"<div class=\"search\">\n" .
- $cgi->hidden(-name => "p") . "\n" .
+ (!$use_pathinfo && $cgi->hidden(-name => "p") . "\n") .
$cgi->hidden(-name => "a") . "\n" .
$cgi->hidden(-name => "h") . "\n" .
$cgi->popup_menu(-name => 'st', -default => 'commit',
--
1.5.2.2.552.gc32f
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: make search form generate pathinfo-style URLs
2007-06-28 18:57 [PATCH] gitweb: make search form generate pathinfo-style URLs Matt McCutchen
@ 2007-07-02 19:03 ` Matt McCutchen
2007-07-02 23:11 ` Junio C Hamano
2007-07-07 21:01 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Matt McCutchen @ 2007-07-02 19:03 UTC (permalink / raw)
To: Junio C Hamano, git
On Thu, 2007-06-28 at 14:57 -0400, Matt McCutchen wrote:
> The search form generated traditional-style URLs with a "p=" parameter
> even when the pathinfo feature was on. This patch makes it generate
> pathinfo-style URLs when appropriate.
I sent this patch four days ago but no one has commented or done
anything about it. Please clue me in: is this typical, or did I do
something wrong or do I need to do something else?
Thanks,
Matt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: make search form generate pathinfo-style URLs
2007-07-02 19:03 ` Matt McCutchen
@ 2007-07-02 23:11 ` Junio C Hamano
0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2007-07-02 23:11 UTC (permalink / raw)
To: Matt McCutchen; +Cc: git, Petr Baudis, Jakub Narebski, Luben Tuikov
Matt McCutchen <hashproduct@gmail.com> writes:
> I sent this patch four days ago but no one has commented or done
> anything about it. Please clue me in: is this typical, or did I do
> something wrong or do I need to do something else?
Yes, it sometimes happens to patches to some areas. No, you did
not do anything wrong as far as I can see. Yes, sending this
kind of reminder out is exactly what is needed.
I have three recent patches from you on gitweb in my patch
queue.
Subject: [PATCH] gitweb: snapshot cleanups & support for offering multiple
formats
Date: Thu, 28 Jun 2007 14:02:13 -0400
Message-ID: <1183053733.6108.0.camel@mattlaptop2>
Subject: [PATCH] gitweb: make search form generate pathinfo-style URLs
Date: Thu, 28 Jun 2007 14:57:07 -0400
Message-ID: <1183057027.6108.4.camel@mattlaptop2>
Subject: [PATCH] gitweb: make "No commits" in project list gray, not bold
green
Date: Thu, 28 Jun 2007 18:15:22 -0400
Message-ID: <1183068922.6108.8.camel@mattlaptop2>
There are people whom I consider "gitweb folks", who are more
familiar with, and more importantly who are more interested in,
gitweb than I am. Having good "subsystem people" makes gitweb a
lower-priority area to myself, and for these patches it made
even so that nobody commented on them.
I should have asked Ack/Nack/Comments from gitweb folks much
earlier, but was a bit too loaded with the day job. Sorry about
that.
So, gitweb folks, what do you think about these patches?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: make search form generate pathinfo-style URLs
2007-06-28 18:57 [PATCH] gitweb: make search form generate pathinfo-style URLs Matt McCutchen
2007-07-02 19:03 ` Matt McCutchen
@ 2007-07-07 21:01 ` Junio C Hamano
2007-07-09 19:03 ` Luben Tuikov
1 sibling, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2007-07-07 21:01 UTC (permalink / raw)
To: Matt McCutchen; +Cc: git, jnareb, pasky, ltuikov
Matt McCutchen <hashproduct@gmail.com> writes:
> The search form generated traditional-style URLs with a "p=" parameter
> even when the pathinfo feature was on. This patch makes it generate
> pathinfo-style URLs when appropriate.
>
> Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
> ---
> gitweb/gitweb.perl | 12 +++++++++---
> 1 files changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index f36428e..7b0e110 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -2215,12 +2215,18 @@ EOF
> } else {
> $search_hash = "HEAD";
> }
> + my $action = $my_uri;
> + my ($use_pathinfo) = gitweb_check_feature('pathinfo');
> + if ($use_pathinfo) {
> + $action .= "/$project";
> + } else {
> + $cgi->param("p", $project);
> + }
> $cgi->param("a", "search");
> $cgi->param("h", $search_hash);
> - $cgi->param("p", $project);
> - print $cgi->startform(-method => "get", -action => $my_uri) .
> + print $cgi->startform(-method => "get", -action => $action) .
> "<div class=\"search\">\n" .
> - $cgi->hidden(-name => "p") . "\n" .
> + (!$use_pathinfo && $cgi->hidden(-name => "p") . "\n") .
Ahhhhh. (!$use_pathinfo && blah) when $use_pathinfo is true
evaluates to an empty string, which saves you from protecting
yourself from undef. Perhaps clever, but is not terribly nice.
Other than that, the patch looks sane to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gitweb: make search form generate pathinfo-style URLs
2007-07-07 21:01 ` Junio C Hamano
@ 2007-07-09 19:03 ` Luben Tuikov
0 siblings, 0 replies; 5+ messages in thread
From: Luben Tuikov @ 2007-07-09 19:03 UTC (permalink / raw)
To: Junio C Hamano, Matt McCutchen; +Cc: git, jnareb, pasky, ltuikov
--- Junio C Hamano <gitster@pobox.com> wrote:
> Matt McCutchen <hashproduct@gmail.com> writes:
>
> > The search form generated traditional-style URLs with a "p=" parameter
> > even when the pathinfo feature was on. This patch makes it generate
> > pathinfo-style URLs when appropriate.
> >
> > Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
> > ---
> > gitweb/gitweb.perl | 12 +++++++++---
> > 1 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> > index f36428e..7b0e110 100755
> > --- a/gitweb/gitweb.perl
> > +++ b/gitweb/gitweb.perl
> > @@ -2215,12 +2215,18 @@ EOF
> > } else {
> > $search_hash = "HEAD";
> > }
> > + my $action = $my_uri;
> > + my ($use_pathinfo) = gitweb_check_feature('pathinfo');
> > + if ($use_pathinfo) {
> > + $action .= "/$project";
> > + } else {
> > + $cgi->param("p", $project);
> > + }
> > $cgi->param("a", "search");
> > $cgi->param("h", $search_hash);
> > - $cgi->param("p", $project);
> > - print $cgi->startform(-method => "get", -action => $my_uri) .
> > + print $cgi->startform(-method => "get", -action => $action) .
> > "<div class=\"search\">\n" .
> > - $cgi->hidden(-name => "p") . "\n" .
> > + (!$use_pathinfo && $cgi->hidden(-name => "p") . "\n") .
>
> Ahhhhh. (!$use_pathinfo && blah) when $use_pathinfo is true
> evaluates to an empty string, which saves you from protecting
> yourself from undef. Perhaps clever, but is not terribly nice.
>
> Other than that, the patch looks sane to me.
Good catch.
Luben
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-07-09 19:03 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-28 18:57 [PATCH] gitweb: make search form generate pathinfo-style URLs Matt McCutchen
2007-07-02 19:03 ` Matt McCutchen
2007-07-02 23:11 ` Junio C Hamano
2007-07-07 21:01 ` Junio C Hamano
2007-07-09 19:03 ` Luben Tuikov
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).