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

[PATCH] contrib/vim: update syntax for changed commit template

From
Jeff King <peff@peff.net>
Date
Jan 23, 2007, 03:21 UTC
Message-ID
<20070123032115.GA20554@coredump.intra.peff.net>
Signed-off-by: Jeff King <peff@peff.net>
---
It looks like things have settled down here, so it would be nice to
apply this before v1.5.0 (though I still think "changed but not updated"
is terrible wording, my previous message to that effect received no
response).
On Thu, Jan 11, 2007 at 08:17:12AM +0100, Juergen Ruehle wrote:
> Thanks for tracking this. It would be nice if we could make the
> syntax highlighting less dependent on the exact wording.

Unfortunately, I don't see another way short of counting which "stanza" we're in, and that is highly dependent on the formatting of stanzas, as well as what the user might have written in his commit message. This way is reasonably robust, and the messages shouldn't change too frequently.

 contrib/vim/syntax/gitcommit.vim |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/vim/syntax/gitcommit.vim b/contrib/vim/syntax/gitcommit.vim
index d911efb..332121b 100644
--- a/contrib/vim/syntax/gitcommit.vim
+++ b/contrib/vim/syntax/gitcommit.vim
@@ -1,7 +1,7 @@
 syn region gitLine start=/^#/ end=/$/
-syn region gitCommit start=/^# Added but not yet committed:$/ end=/^#$/ contains=gitHead,gitCommitFile
+syn region gitCommit start=/^# Changes to be committed:$/ end=/^#$/ contains=gitHead,gitCommitFile
 syn region gitHead contained start=/^#   (.*)/ end=/^#$/
-syn region gitChanged start=/^# Changed but not added:/ end=/^#$/ contains=gitHead,gitChangedFile
+syn region gitChanged start=/^# Changed but not updated:/ end=/^#$/ contains=gitHead,gitChangedFile
 syn region gitUntracked start=/^# Untracked files:/ end=/^#$/ contains=gitHead,gitUntrackedFile
 
 syn match gitCommitFile contained /^#\t.*/hs=s+2
-- 
1.5.0.rc1.gda86
Message 1 of 1 in “contrib/vim: update syntax for changed commit template”
  1. contrib/vim: update syntax for changed commit templateJeff King, Jan 23, 2007

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.