From: Jakub Narebski Date: Wed, 22 Jun 2011 15:28:54 GMT Subject: [PATCH 4/5] gitweb: Clean up code in git_search_* subroutines Message-ID: <1308756535-29701-5-git-send-email-jnareb@gmail.com> In-Reply-To: <1308756535-29701-1-git-send-email-jnareb@gmail.com> 1. Replace sequence of $foo .= "bar"; $foo .= "baz"; with $foo .= "bar" . "baz"; 2. Use href(-replay=>1, -page=>undef) for first page of a multip-page view. 3. Rewrap (rearrange) some lines to reduce their length. Some lines still have more than 80 characters, but lines are shorter now. No functional changes. Signed-off-by: Jakub Narebski --- gitweb/gitweb.perl | 29 ++++++++++++++++------------- 1 files changed, 16 insertions(+), 13 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index c350c05..1c06476 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5559,16 +5559,13 @@ sub git_search_message { my $paging_nav = ''; if ($page > 0) { $paging_nav .= - $cgi->a({-href => href(action=>"search", hash=>$hash, - searchtext=>$searchtext, - searchtype=>$searchtype)}, - "first"); - $paging_nav .= " ⋅ " . + $cgi->a({-href => href(-replay=>1, page=>undef)}, + "first") . + " ⋅ " . $cgi->a({-href => href(-replay=>1, page=>$page-1), -accesskey => "p", -title => "Alt-p"}, "prev"); } else { - $paging_nav .= "first"; - $paging_nav .= " ⋅ prev"; + $paging_nav .= "first ⋅ prev"; } my $next_link = ''; if ($#commitlist >= 100) { @@ -5613,10 +5610,13 @@ sub git_search_changes { if (%co) { print "\n" . "" . - $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") . + $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, + "commit") . " | " . - $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree"); - print "\n" . + $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, + hash_base=>$co{'id'})}, + "tree") . + "\n" . "\n"; } @@ -5650,10 +5650,13 @@ sub git_search_changes { if (%co) { print "\n" . "" . - $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, "commit") . + $cgi->a({-href => href(action=>"commit", hash=>$co{'id'})}, + "commit") . " | " . - $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$co{'id'})}, "tree"); - print "\n" . + $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, + hash_base=>$co{'id'})}, + "tree") . + "\n" . "\n"; } -- 1.7.5