summaryrefslogtreecommitdiff
path: root/gitweb
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-08-07 21:56:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-08-09 20:05:35 (GMT)
commit497d9c343902591e98a6612385d529816420ea94 (patch)
tree58d5bfc0dd6b6a654986bc266c89625f9050c144 /gitweb
parent977ed83a6da635332a0c9e4cdd8b7e1715a9d363 (diff)
downloadgit-497d9c343902591e98a6612385d529816420ea94.zip
git-497d9c343902591e98a6612385d529816420ea94.tar.gz
git-497d9c343902591e98a6612385d529816420ea94.tar.bz2
gitweb: clarify search results page when no matching commit found
When searching commits for a string that never occurs, the results page looks something like this: projects / foo.git / search \o/ summary | ... | tree [commit] search: [ kfjdkas ] [ ]re first ⋅ prev ⋅ next Merge branch 'maint' Foo: a demonstration project Without a list of hits to compare it to, the header describing the commit named by the hash parameter (usually HEAD) may itself look like a hit. Add some text (“No match.”) to replace the empty list of hits and avoid this confusion. While at it, remove some nearby dead code, left behind from a simplification a few years ago (v1.5.4-rc0~276^2~4, 2007-11-01). Noticed-by: Erick Mattos <erick.mattos@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl9
1 files changed, 5 insertions, 4 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index cedc357..6deec87 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -6522,12 +6522,13 @@ sub git_search {
$paging_nav .= " &sdot; next";
}
- if ($#commitlist >= 100) {
- }
-
git_print_page_nav('','', $hash,$co{'tree'},$hash, $paging_nav);
git_print_header_div('commit', esc_html($co{'title'}), $hash);
- git_search_grep_body(\@commitlist, 0, 99, $next_link);
+ if ($page == 0 && !@commitlist) {
+ print "<p>No match.</p>\n";
+ } else {
+ git_search_grep_body(\@commitlist, 0, 99, $next_link);
+ }
}
if ($searchtype eq 'pickaxe') {