git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Added syntax highlight support for golang

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 7, 2014, 23:01 UTC
Message-ID
<xmqqa9e2ttln.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAK9CXBUewMhr19KarmymOXmoq1ijPuU2mq4hqc6a-W0TCq5SRg@mail.gmail.com>
Pavan Kumar Sunkara <pavan.sss1991@gmail.com> writes:
> Sorry. I misunderstood your message. Yes, I guess lazy loading the
> supported file extensions would be better. But not all highlighters
> support `-p` option. So, I think its better to leave it to the user.

Yes, those highlighters that do not support `-p` may have to rely on the hard-coded list %highlight_ext.

But with the same line of reasoning, not all versions of highligher supports 'go' language, so it's better to leave that to the user, no? The version of 'highlight' you may have may know about 'go', and somebody else's 'highlight' may not yet. A hard-coded list that appears in %highlight_ext will be correct for only one of you while the other between you two needs to customize it to his system.

Note that I was not talking about removing the configurability. Even with lazy loading and/or auto-genearting at build-install time when 'highlight -p' is available, the users still want to be able to customize, and supporting that is fine.

But for those whose 'highlight' does support '-p', it will help to lazily discover the list of supported languages and/or enumarate them at build-install time. They do not have to keep adding new language (or removing it from the list we give as the upstream) to adjust it to their system.

In any case, the comment was not about this patch from you, but about the future direction for the code it touches in general. In other words, it did not mean "because it does not update the mechanism to lazily discover the list of languages, and instead added yet another language to the existing one, it is not an acceptable solution to start supporting 'go'".

Previous: Pavan Kumar SunkaraNext: Pavan Kumar Sunkara
Message 5 of 6 in “gitweb: Added syntax highlight support for golang”
  1. gitweb: Added syntax highlight support for golangPavan Kumar Sunkara, Feb 7, 2014
  2. Junio C HamanoFeb 7, 2014
  3. Pavan Kumar SunkaraFeb 7, 2014
  4. Pavan Kumar SunkaraFeb 7, 2014
  5. Junio C HamanoFeb 7, 2014
  6. Pavan Kumar SunkaraFeb 7, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.