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

Re: [PATCH] vim syntax: highlight the diff in commit message template

From
Jeff King <peff@peff.net>
Date
Sep 24, 2008, 15:57 UTC
Message-ID
<20080924155745.GA3908@coredump.intra.peff.net>
In-Reply-To
<1222269726-15632-1-git-send-email-szeder@ira.uka.de>
On Wed, Sep 24, 2008 at 05:22:06PM +0200, SZEDER Gábor wrote:
> The template generated by 'git commit -v' is much easier to read now.

I think the goal of this change is good, but I'm not sure about the implementation:

> +source $VIMRUNTIME/syntax/diff.vim

Despite having written the original gitcommit.vim, I am largely clueless about vim syntax highlighting. However, the gitcommit.vim shipped with vim 7.2 does this:

  syn include @gitcommitDiff syntax/diff.vim
  syn region gitcommitDiff start=/\%(^diff --git \)\@=/ end=/^$\|^#\@=/ contains=@gitcommitDiff

which seems a bit more robust to me. I have no idea if that syntax introduces any limitations about which versions of vim can be used.

However, this brings up a more important question: is there any reason for git to ship a vim syntax file when there is already a maintained (and IMHO, much superior) one that ships with vim? The only people who should need our file are people on versions of vim older than the ones that ship gitcommit.vim. For those people, I suspect they are better off going to vim.org and grabbing the up to date (and undoubtedly more carefully constructed) syntax file rather than pulling what is in our contrib/ area.

Is there any objection to simply removing it (and probably replacing it with a note to go look at the official highlighting file)?

-Peff
Previous: SZEDER GáborNext: SZEDER Gábor
Message 2 of 14 in “vim syntax: highlight the diff in commit message template”
  1. vim syntax: highlight the diff in commit message templateSZEDER Gábor, Sep 24, 2008
  2. Jeff KingSep 24, 2008
  3. SZEDER GáborSep 24, 2008
  4. remove vim syntax highlighting in favor of upstreamJeff King, Sep 24, 2008
  5. Shawn O. PearceSep 24, 2008
  6. Garry DolleySep 24, 2008
  7. SZEDER GáborSep 24, 2008
  8. Jeff KingSep 24, 2008
  9. SZEDER GáborSep 25, 2008
  10. Bob HiestandSep 25, 2008
  11. Shawn O. PearceSep 29, 2008
  12. remove vim syntax highlighting in favor of upstreamSZEDER Gábor, Sep 29, 2008
  13. Jeff KingSep 29, 2008
  14. Michael J GruberSep 30, 2008

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.