Merge branch 'pp/gitweb-config-underscore'
authorJunio C Hamano <gitster@pobox.com>
Thu, 29 Nov 2012 20:52:16 +0000 (12:52 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Nov 2012 20:52:17 +0000 (12:52 -0800)
The key "gitweb.remote_heads" is not legal git config; this maps it to
"gitweb.remoteheads".

* pp/gitweb-config-underscore:
gitweb: make remote_heads config setting work

1  2 
gitweb/gitweb.perl
diff --combined gitweb/gitweb.perl
index e8812fa2b9145cf669193b2b148a0a8e6ee7ac09,c421fa4fba5f9fddde252eea30ec3822bc59255b..0f207f2e20b0c3c30e62c1fd6f0526d38868776f
@@@ -270,15 -270,16 +270,15 @@@ our %highlight_basename = 
  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 sql make),
 +      (map { $_ => $_ } qw(py rb java css js tex bib xml awk bat ini spec tcl sql)),
        # alternate extensions, see /etc/highlight/filetypes.conf
 -      'h' => 'c',
 -      map { $_ => 'sh'  } qw(bash zsh ksh),
 -      map { $_ => 'cpp' } qw(cxx c++ cc),
 -      map { $_ => 'php' } qw(php3 php4 php5 phps),
 -      map { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'
 -      map { $_ => 'make'} qw(mak mk),
 -      map { $_ => 'xml' } qw(xhtml html htm),
 +      (map { $_ => 'c'   } qw(c h)),
 +      (map { $_ => 'sh'  } qw(sh bash zsh ksh)),
 +      (map { $_ => 'cpp' } qw(cpp cxx c++ cc)),
 +      (map { $_ => 'php' } qw(php php3 php4 php5 phps)),
 +      (map { $_ => 'pl'  } qw(pl perl pm)), # perhaps also 'cgi'
 +      (map { $_ => 'make'} qw(make mak mk)),
 +      (map { $_ => 'xml' } qw(xml xhtml html htm)),
  );
  
  # You define site-wide feature defaults here; override them with
@@@ -540,7 -541,7 +540,7 @@@ our %feature = 
        # $feature{'remote_heads'}{'default'} = [1];
        # To have project specific config enable override in $GITWEB_CONFIG
        # $feature{'remote_heads'}{'override'} = 1;
-       # and in project config gitweb.remote_heads = 0|1;
+       # and in project config gitweb.remoteheads = 0|1;
        'remote_heads' => {
                'sub' => sub { feature_bool('remote_heads', @_) },
                'override' => 0,
@@@ -2696,12 -2697,15 +2696,15 @@@ sub git_get_project_config 
        # only subsection, if exists, is case sensitive,
        # and not lowercased by 'git config -z -l'
        if (my ($hi, $mi, $lo) = ($key =~ /^([^.]*)\.(.*)\.([^.]*)$/)) {
+               $lo =~ s/_//g;
                $key = join(".", lc($hi), $mi, lc($lo));
+               return if ($lo =~ /\W/ || $hi =~ /\W/);
        } else {
                $key = lc($key);
+               $key =~ s/_//g;
+               return if ($key =~ /\W/);
        }
        $key =~ s/^gitweb\.//;
-       return if ($key =~ m/\W/);
  
        # type sanity check
        if (defined $type) {
@@@ -8054,7 -8058,6 +8057,7 @@@ sub git_feed 
                $feed_type = 'history';
        }
        $title .= " $feed_type";
 +      $title = esc_html($title);
        my $descr = git_get_project_description($project);
        if (defined $descr) {
                $descr = esc_html($descr);