# Re: [PATCH] gitweb.perl: fix %highlight_ext mappings

3 messages from 2012-11-02 to 2012-11-04. Participants: Jeff King, rh.
Thread: https://gitlist.dev/t/32009

## rh, 2012-11-02 21:12

Subject: [PATCH] gitweb.perl: fix %highlight_ext mappings
Message-ID: <20121102141226.643a96e61b8bf383428c5287@lavabit.com>
URL: https://gitlist.dev/e/20121102141226.643a96e61b8bf383428c5287%40lavabit.com

```

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


```

## Jeff King, 2012-11-04 13:48

Subject: Re: [PATCH] gitweb.perl: fix %highlight_ext mappings
Message-ID: <20121104134841.GC31623@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20121104134841.GC31623%40sigill.intra.peff.net
In-Reply-To: <20121102141226.643a96e61b8bf383428c5287@lavabit.com>

```
On Fri, Nov 02, 2012 at 02:12:26PM -0700, rh wrote:

> 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

Close on the format. There should be a "---" after the sign-off but
before the diff. I can fix it up locally (and the patch looks good to
me).

However, one final thing: the point of the sign-off is to indicate that
you are legally OK to release the code under the DCO. For that reason,
we usually require a real name (not rh). I can guess at your real name
from your email, but I'd rather be sure. Can you provide it?

-Peff

```

## rh, 2012-11-04 17:44

Subject: Re: [PATCH] gitweb.perl: fix %highlight_ext mappings
Message-ID: <20121104094422.7273cd146654f06ccb1b2baa@lavabit.com>
URL: https://gitlist.dev/e/20121104094422.7273cd146654f06ccb1b2baa%40lavabit.com
In-Reply-To: <20121104134841.GC31623@sigill.intra.peff.net>

```
On Sun, 4 Nov 2012 08:48:41 -0500
Jeff King <peff@peff.net> wrote:

> On Fri, Nov 02, 2012 at 02:12:26PM -0700, rh wrote:
> 
> > 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
> 
> Close on the format. There should be a "---" after the sign-off but
> before the diff. I can fix it up locally (and the patch looks good to
> me).
> 
> However, one final thing: the point of the sign-off is to indicate
> that you are legally OK to release the code under the DCO. For that
> reason, we usually require a real name (not rh). I can guess at your
> real name from your email, but I'd rather be sure. Can you provide it?

Roger wilco. Resubmitting. 
Thanks for the time and consideration.
> 
> -Peff


-- 



```
