git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb.perl: fix %highlight_ext mappings
@ 2012-11-04 17:45 rh
  2012-11-08 18:01 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: rh @ 2012-11-04 17:45 UTC (permalink / raw)
  To: git


The previous change created a dictionary of one-to-one elements when
the intent was to map mutliple related types to one main type.
e.g. bash, ksh, zsh, sh all map to sh since they share similar syntax
This makes the mapping as the original change intended.

Signed-off-by: Richard Hubbell <richard_hubbe11@lavabit.com>
---
gitweb.cgi | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/gitweb.cgi.orig b/gitweb.cgi
index 060db27..155b238 100755
--- a/gitweb.cgi.orig
+++ b/gitweb.cgi
@@ -246,19 +246,19 @@ our %highlight_basename = (
 	'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 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] gitweb.perl: fix %highlight_ext mappings
@ 2012-11-02 21:12 rh
  2012-11-04 13:48 ` Jeff King
  0 siblings, 1 reply; 6+ messages in thread
From: rh @ 2012-11-02 21:12 UTC (permalink / raw)
  To: git


The previous change created a dictionary of one-to-one elements when
the intent was to map mutliple related types to one main type.
e.g. bash, ksh, zsh, sh all map to sh since they share similar syntax
This makes the mapping as the original change intended.

Signed-off-by: rh <richard_hubbe11@lavabit.com>

diff --git a/gitweb.cgi.orig b/gitweb.cgi
index 060db27..155b238 100755
--- a/gitweb.cgi.orig
+++ b/gitweb.cgi
@@ -246,19 +246,19 @@ our %highlight_basename = (
 	'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 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-08 18:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-04 17:45 [PATCH] gitweb.perl: fix %highlight_ext mappings rh
2012-11-08 18:01 ` Jeff King
2012-11-08 18:36   ` rh
  -- strict thread matches above, loose matches on Subject: below --
2012-11-02 21:12 rh
2012-11-04 13:48 ` Jeff King
2012-11-04 17:44   ` rh

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).