{"thread":{"id":"32042","subject":"Re: [PATCH] gitweb.perl: fix %highlight_ext mappings","startedAt":"2012-11-04T17:45:55Z","lastAt":"2012-11-08T18:36:20Z","messageCount":3,"participants":["Jeff King","rh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"299194","messageId":"20121104094555.a46992b6d836c1e09524d2cc@lavabit.com","threadId":"32042","inReplyTo":null,"subject":"[PATCH] gitweb.perl: fix %highlight_ext mappings","fromName":"rh","fromEmail":"richard_hubbe11@lavabit.com","sentAt":"2012-11-04T17:45:55Z","receivedAt":"2012-11-04T17:45:55Z","isPatch":true,"sender":{"key":"richard_hubbe11@lavabit.com","avatar":null},"body":"\nThe previous change created a dictionary of one-to-one elements when\nthe intent was to map mutliple related types to one main type.\ne.g. bash, ksh, zsh, sh all map to sh since they share similar syntax\nThis makes the mapping as the original change intended.\n\nSigned-off-by: Richard Hubbell <richard_hubbe11@lavabit.com>\n---\ngitweb.cgi | 18 +++++++++---------\n1 file changed, 9 insertions(+), 9 deletions(-)\n\ndiff --git a/gitweb.cgi.orig b/gitweb.cgi\nindex 060db27..155b238 100755\n--- a/gitweb.cgi.orig\n+++ b/gitweb.cgi\n@@ -246,19 +246,19 @@ our %highlight_basename = (\n \t'Makefile' => 'make',\n );\n # match by extension\n+\n our %highlight_ext = (\n \t# main extensions, defining name of syntax;\n \t# see files in /usr/share/highlight/langDefs/ directory\n-\tmap { $_ => $_ }\n-\t\tqw(py c cpp rb java css php sh pl js tex bib xml awk bat ini spec tcl sql make),\n+\t(map { $_ => $_ } qw(py rb java css js tex bib xml awk bat ini spec tcl sql)),\n \t# alternate extensions, see /etc/highlight/filetypes.conf\n-\t'h' => 'c',\n-\tmap { $_ => 'sh'  } qw(bash zsh ksh),\n-\tmap { $_ => 'cpp' } qw(cxx c++ cc),\n-\tmap { $_ => 'php' } qw(php3 php4 php5 phps),\n-\tmap { $_ => 'pl'  } qw(perl pm), # perhaps also 'cgi'\n-\tmap { $_ => 'make'} qw(mak mk),\n-\tmap { $_ => 'xml' } qw(xhtml html htm),\n+\t(map { $_ => 'c'   } qw(c h)),\n+\t(map { $_ => 'sh'  } qw(sh bash zsh ksh)),\n+\t(map { $_ => 'cpp' } qw(cpp cxx c++ cc)),\n+\t(map { $_ => 'php' } qw(php php3 php4 php5 phps)),\n+\t(map { $_ => 'pl'  } qw(pl perl pm)), # perhaps also 'cgi'\n+\t(map { $_ => 'make'} qw(make mak mk)),\n+\t(map { $_ => 'xml' } qw(xml xhtml html htm)),\n );\n \n # You define site-wide feature defaults here; override them with\n\n"},{"id":"202659","messageId":"20121108180157.GK15560@sigill.intra.peff.net","threadId":"32042","inReplyTo":"20121104094555.a46992b6d836c1e09524d2cc@lavabit.com","subject":"Re: [PATCH] gitweb.perl: fix %highlight_ext mappings","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2012-11-08T18:01:57Z","receivedAt":"2012-11-08T18:01:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Nov 04, 2012 at 09:45:55AM -0800, rh wrote:\n\n> The previous change created a dictionary of one-to-one elements when\n> the intent was to map mutliple related types to one main type.\n> e.g. bash, ksh, zsh, sh all map to sh since they share similar syntax\n> This makes the mapping as the original change intended.\n> \n> Signed-off-by: Richard Hubbell <richard_hubbe11@lavabit.com>\n\nThanks.\n\n> diff --git a/gitweb.cgi.orig b/gitweb.cgi\n> index 060db27..155b238 100755\n> --- a/gitweb.cgi.orig\n> +++ b/gitweb.cgi\n\nThis is not the name of the source file in git.git, so \"git am\" choked.\nI was able to fix it up locally, though. No need to resend.\n\n-Peff\n"},{"id":"299195","messageId":"20121108103620.eb716adb2d7542c606c8b87a@lavabit.com","threadId":"32042","inReplyTo":"20121108180157.GK15560@sigill.intra.peff.net","subject":"Re: [PATCH] gitweb.perl: fix %highlight_ext mappings","fromName":"rh","fromEmail":"richard_hubbe11@lavabit.com","sentAt":"2012-11-08T18:36:20Z","receivedAt":"2012-11-08T18:36:20Z","isPatch":true,"sender":{"key":"richard_hubbe11@lavabit.com","avatar":null},"body":"On Thu, 8 Nov 2012 13:01:57 -0500\nJeff King <peff@peff.net> wrote:\n\n> On Sun, Nov 04, 2012 at 09:45:55AM -0800, rh wrote:\n> \n> > The previous change created a dictionary of one-to-one elements when\n> > the intent was to map mutliple related types to one main type.\n> > e.g. bash, ksh, zsh, sh all map to sh since they share similar\n> > syntax This makes the mapping as the original change intended.\n> > \n> > Signed-off-by: Richard Hubbell <richard_hubbe11@lavabit.com>\n> \n> Thanks.\n> \n> > diff --git a/gitweb.cgi.orig b/gitweb.cgi\n> > index 060db27..155b238 100755\n> > --- a/gitweb.cgi.orig\n> > +++ b/gitweb.cgi\n> \n> This is not the name of the source file in git.git, so \"git am\"\n> choked. I was able to fix it up locally, though. No need to resend.\n\nSomehow I knew that it wouldn't be a slam dunk!\nThanks for doing what you do.  FWIW maybe others can follow\nthis thread to know what not to do.  And save you extra work.\n\n> \n> -Peff\n\n--\n\"Now, in his heart, Ahab had some glimpse of this, namely; all my means\nare sane, my motive and my object mad.\"\n\n"}]}