From: Jakub Narebski Date: Wed, 22 Jun 2011 15:28:54 +0000 (+0200) Subject: gitweb: Clean up code in git_search_* subroutines X-Git-Tag: v1.7.7-rc0~81^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=882541b87d8f7bedca824228a8ad14aed69c904e;p=git.git gitweb: Clean up code in git_search_* subroutines Replace sequence of $foo .= "bar"; $foo .= "baz"; with $foo .= "bar" . "baz"; Use href(-replay=>1, -page=>undef) for first page of a multipl-page view. Wrap some lines to reduce their length. Some lines still have more than 80 characters, but lines are shorter now. No functional changes intended. Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 9d9dc0149..80cbe66ea 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5273,16 +5273,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) { @@ -5327,10 +5324,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"; } @@ -5364,10 +5364,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"; }