All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Cc: git@vger.kernel.org,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Jakub Narębski" <jnareb@gmail.com>
Subject: Re: [PATCH] gitweb: Added syntax highlight support for golang
Date: Fri, 07 Feb 2014 13:54:11 -0800	[thread overview]
Message-ID: <xmqqiosqtwqk.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1391807441-23049-1-git-send-email-pavan.sss1991@gmail.com> (Pavan Kumar Sunkara's message of "Sat, 8 Feb 2014 02:40:41 +0530")

Pavan Kumar Sunkara <pavan.sss1991@gmail.com> writes:

> Golang is quickly becoming one of the major programming languages.
>
> This change switches on golang syntax highlight support by default
> in gitweb rather than asking the users to do it using config files.

Looks trivially harmless ;-)

I haven't touched this part of our system, but the patch makes me
wonder if there is a way for us to _ask_ the installed 'highlight'
binary what languages it knows about.  This hash is used only in
guess_file_syntax sub, and it may not be unreasonable to populate it
lazily there, or at least generate this part by parsing output from
'highlight -p' at build-install time.

> Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
> ---
>  gitweb/gitweb.perl |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index bf7fd67..aa6fcfd 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -273,7 +273,7 @@ our %highlight_basename = (
>  our %highlight_ext = (
>  	# main extensions, defining name of syntax;
>  	# see files in /usr/share/highlight/langDefs/ directory
> -	(map { $_ => $_ } qw(py rb java css js tex bib xml awk bat ini spec tcl sql)),
> +	(map { $_ => $_ } qw(py rb java go css js tex bib xml awk bat ini spec tcl sql)),
>  	# alternate extensions, see /etc/highlight/filetypes.conf
>  	(map { $_ => 'c'   } qw(c h)),
>  	(map { $_ => 'sh'  } qw(sh bash zsh ksh)),

  reply	other threads:[~2014-02-07 21:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-07 21:10 [PATCH] gitweb: Added syntax highlight support for golang Pavan Kumar Sunkara
2014-02-07 21:54 ` Junio C Hamano [this message]
2014-02-07 21:56   ` Pavan Kumar Sunkara
2014-02-07 21:58     ` Pavan Kumar Sunkara
2014-02-07 23:01       ` Junio C Hamano
2014-02-07 23:10         ` Pavan Kumar Sunkara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqiosqtwqk.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    --cc=pavan.sss1991@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.