Code

Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Mon, 9 Aug 2010 20:05:47 +0000 (13:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Aug 2010 20:05:47 +0000 (13:05 -0700)
* maint:
  gitweb: clarify search results page when no matching commit found
  Documentation: add a FILES section for show-ref
  Makefile: add missing dependency on http.h
  Makefile: add missing dependencies on url.h
  Documentation/git-log: Clarify --full-diff
  git-rebase: fix typo when parsing --force-rebase
  imap-send: Fix sprintf usage
  prune: allow --dry-run for -n and --verbose for -v
  notes: allow --dry-run for -n and --verbose for -v
  Document -B<n>[/<m>], -M<n> and -C<n> variants of -B, -M and -C
  Documentation: cite git-am from git-apply
  t7003: fix subdirectory-filter test
  Allow "check-ref-format --branch" from subdirectory
  check-ref-format: handle subcommands in separate functions
  pretty-options.txt: match --format's documentation with implementation.

1  2 
gitweb/gitweb.perl

diff --combined gitweb/gitweb.perl
index 8b0276727146d6fbd9123b6bbe8b5f0631f823b1,6deec87e5d26b963902f80049ca0e34f76daa0bc..4efeebc2276e5532938c25a8eaa188590fbdb794
@@@ -232,29 -232,6 +232,29 @@@ our %avatar_size = 
  # Leave it undefined (or set to 'undef') to turn off load checking.
  our $maxload = 300;
  
 +# configuration for 'highlight' (http://www.andre-simon.de/)
 +# match by basename
 +our %highlight_basename = (
 +      #'Program' => 'py',
 +      #'Library' => 'py',
 +      'SConstruct' => 'py', # SCons equivalent of Makefile
 +      'Makefile' => 'make',
 +);
 +# match by extension
 +our %highlight_ext = (
 +      # main extensions, defining name of syntax;
 +      # see files in /usr/share/highlight/langDefs/ directory
 +      map { $_ => $_ }
 +              qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
 +      # alternate extensions, see /etc/highlight/filetypes.conf
 +      'h' => 'c',
 +      map { $_ => 'cpp' } qw(cxx c++ cc),
 +      map { $_ => 'php' } qw(php3 php4),
 +      map { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'
 +      'mak' => 'make',
 +      map { $_ => 'xml' } qw(xhtml html htm),
 +);
 +
  # You define site-wide feature defaults here; override them with
  # $GITWEB_CONFIG as necessary.
  our %feature = (
@@@ -1125,7 -1102,7 +1125,7 @@@ sub run 
  
                run_request();
  
 -              $pre_dispatch_hook->()
 +              $post_dispatch_hook->()
                        if $post_dispatch_hook;
  
                last REQUEST if ($is_last_request->());
@@@ -3339,6 -3316,30 +3339,6 @@@ sub blob_contenttype 
  sub guess_file_syntax {
        my ($highlight, $mimetype, $file_name) = @_;
        return undef unless ($highlight && defined $file_name);
 -
 -      # configuration for 'highlight' (http://www.andre-simon.de/)
 -      # match by basename
 -      my %highlight_basename = (
 -              #'Program' => 'py',
 -              #'Library' => 'py',
 -              'SConstruct' => 'py', # SCons equivalent of Makefile
 -              'Makefile' => 'make',
 -      );
 -      # match by extension
 -      my %highlight_ext = (
 -              # main extensions, defining name of syntax;
 -              # see files in /usr/share/highlight/langDefs/ directory
 -              map { $_ => $_ }
 -                      qw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl),
 -              # alternate extensions, see /etc/highlight/filetypes.conf
 -              'h' => 'c',
 -              map { $_ => 'cpp' } qw(cxx c++ cc),
 -              map { $_ => 'php' } qw(php3 php4),
 -              map { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'
 -              'mak' => 'make',
 -              map { $_ => 'xml' } qw(xhtml html htm),
 -      );
 -
        my $basename = basename($file_name, '.in');
        return $highlight_basename{$basename}
                if exists $highlight_basename{$basename};
@@@ -6521,12 -6522,13 +6521,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') {