From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: John 'Warthog9' Hawley <warthog9@kernel.org>,
admin@repo.or.cz, Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH 4/5] gitweb: Clean up code in git_search_* subroutines
Date: Wed, 22 Jun 2011 17:28:54 +0200 [thread overview]
Message-ID: <1308756535-29701-5-git-send-email-jnareb@gmail.com> (raw)
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 <jnareb@gmail.com>
---
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 "</td>\n" .
"<td class=\"link\">" .
- $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 "</td>\n" .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'},
+ hash_base=>$co{'id'})},
+ "tree") .
+ "</td>\n" .
"</tr>\n";
}
@@ -5650,10 +5650,13 @@ sub git_search_changes {
if (%co) {
print "</td>\n" .
"<td class=\"link\">" .
- $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 "</td>\n" .
+ $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'},
+ hash_base=>$co{'id'})},
+ "tree") .
+ "</td>\n" .
"</tr>\n";
}
--
1.7.5
next prev parent reply other threads:[~2011-06-22 15:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-22 15:28 [PATCH 0/5] gitweb: Improve search code Jakub Narebski
2011-06-22 15:28 ` [PATCHv3 1/5] gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled Jakub Narebski
2011-06-22 15:28 ` [PATCH 2/5] gitweb: Check permissions first in git_search Jakub Narebski
2011-06-22 15:28 ` [PATCH 3/5] gitweb: Split body of git_search into subroutines Jakub Narebski
2011-06-22 15:28 ` Jakub Narebski [this message]
2011-06-22 15:28 ` [PATCH 5/5] gitweb: Make git_search_* subroutines render whole pages Jakub Narebski
2011-06-22 17:10 ` [PATCH 0/5] gitweb: Improve search code Phil Hord
2011-06-22 18:00 ` Jakub Narebski
2011-06-22 19:24 ` Phil Hord
2011-06-22 18:55 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1308756535-29701-5-git-send-email-jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=admin@repo.or.cz \
--cc=git@vger.kernel.org \
--cc=warthog9@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).