{"thread":{"id":"5539","subject":"[PATCH] contrib/vim: add syntax highlighting file for commits","startedAt":"2006-09-11T23:22:49Z","lastAt":"2006-09-13T06:46:40Z","messageCount":6,"participants":["Jeff King","Tom Prince","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"26749","messageId":"20060911232249.GB29736@coredump.intra.peff.net","threadId":"5539","inReplyTo":null,"subject":"[PATCH] contrib/vim: add syntax highlighting file for commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-09-11T23:22:49Z","receivedAt":"2006-09-11T23:22:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"\nSigned-off-by: Jeff King <peff@peff.net>\n---\nThere were at least a few positive comments on this, and hey, we have to\nbalance the contrib/emacs directory!\n\n contrib/vim/README            |    7 +++++++\n contrib/vim/commit-syntax.vim |   18 ++++++++++++++++++\n 2 files changed, 25 insertions(+), 0 deletions(-)\n\ndiff --git a/contrib/vim/README b/contrib/vim/README\nnew file mode 100644\nindex 0000000..bad0a05\n--- /dev/null\n+++ b/contrib/vim/README\n@@ -0,0 +1,7 @@\n+To syntax highlight git's commit messages, you need to:\n+  1. Copy commit-syntax.vim to vim's syntax directory:\n+     $ cp commit-syntax.vim $HOME/.vim/syntax/gitcommit.vim\n+  2. Auto-detect the editing of git commit files:\n+     $ cat >>$HOME/.vimrc <<'EOF'\n+     autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit\n+     EOF\ndiff --git a/contrib/vim/commit-syntax.vim b/contrib/vim/commit-syntax.vim\nnew file mode 100644\nindex 0000000..a9de09f\n--- /dev/null\n+++ b/contrib/vim/commit-syntax.vim\n@@ -0,0 +1,18 @@\n+syn region gitLine start=/^#/ end=/$/\n+syn region gitCommit start=/^# Updated but not checked in:$/ end=/^#$/ contains=gitHead,gitCommitFile\n+syn region gitHead contained start=/^#   (.*)/ end=/^#$/\n+syn region gitChanged start=/^# Changed but not updated:/ end=/^#$/ contains=gitHead,gitChangedFile\n+syn region gitUntracked start=/^# Untracked files:/ end=/^#$/ contains=gitHead,gitUntrackedFile\n+\n+syn match gitCommitFile contained /^#\\t.*/hs=s+2\n+syn match gitChangedFile contained /^#\\t.*/hs=s+2\n+syn match gitUntrackedFile contained /^#\\t.*/hs=s+2\n+\n+hi def link gitLine Comment\n+hi def link gitCommit Comment\n+hi def link gitChanged Comment\n+hi def link gitHead Comment\n+hi def link gitUntracked Comment\n+hi def link gitCommitFile Type\n+hi def link gitChangedFile Constant\n+hi def link gitUntrackedFile Constant\n-- \n1.4.2.g39f1\n"},{"id":"26760","messageId":"20060912020813.GD26332@socrates.priv","threadId":"5539","inReplyTo":"20060911232249.GB29736@coredump.intra.peff.net","subject":"Re: [PATCH] contrib/vim: add syntax highlighting file for commits","fromName":"Tom Prince","fromEmail":"tom.prince@ualberta.net","sentAt":"2006-09-12T02:08:13Z","receivedAt":"2006-09-12T02:08:13Z","isPatch":true,"sender":{"key":"tom.prince@ualberta.net","avatar":"https://gravatar.com/avatar/a0ad19caee7618876339485106ec994f5202505eecd210ba5c0bd869feaa555a?d=mp&s=160"},"body":"On Mon, Sep 11, 2006 at 07:22:49PM -0400, Jeff King wrote:\n> +  1. Copy commit-syntax.vim to vim's syntax directory:\n> +     $ cp commit-syntax.vim $HOME/.vim/syntax/gitcommit.vim\n...\n> diff --git a/contrib/vim/commit-syntax.vim b/contrib/vim/commit-syntax.vim\n\nIt would be more obvious if you could do cp gitcomit.vim $HOME/.vim/syntax/\n\n  Tom\n"},{"id":"26761","messageId":"20060912023256.GA6596@coredump.intra.peff.net","threadId":"5539","inReplyTo":"20060912020813.GD26332@socrates.priv","subject":"Re: [PATCH] contrib/vim: add syntax highlighting file for commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-09-12T02:32:57Z","receivedAt":"2006-09-12T02:32:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Sep 11, 2006 at 08:08:13PM -0600, Tom Prince wrote:\n\n> > +  1. Copy commit-syntax.vim to vim's syntax directory:\n> > +     $ cp commit-syntax.vim $HOME/.vim/syntax/gitcommit.vim\n> It would be more obvious if you could do cp gitcomit.vim $HOME/.vim/syntax/\n\nIt would be with only one file, but you could just as easily have a\n.vim/ftplugin/gitcommit.vim file (I think there are others, too). If you\nwant to give it the \"proper\" name, it should probably be\nsyntax/gitcommit.vim.\n\n-Peff\n"},{"id":"26786","messageId":"7vy7so9txj.fsf@assigned-by-dhcp.cox.net","threadId":"5539","inReplyTo":"20060912023256.GA6596@coredump.intra.peff.net","subject":"Re: [PATCH] contrib/vim: add syntax highlighting file for commits","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-09-13T06:12:08Z","receivedAt":"2006-09-13T06:12:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Mon, Sep 11, 2006 at 08:08:13PM -0600, Tom Prince wrote:\n>\n>> > +  1. Copy commit-syntax.vim to vim's syntax directory:\n>> > +     $ cp commit-syntax.vim $HOME/.vim/syntax/gitcommit.vim\n>> It would be more obvious if you could do cp gitcomit.vim $HOME/.vim/syntax/\n>\n> It would be with only one file, but you could just as easily have a\n> .vim/ftplugin/gitcommit.vim file (I think there are others, too). If you\n> want to give it the \"proper\" name, it should probably be\n> syntax/gitcommit.vim.\n\nI am not a vim user, but my reading of Tom's comment is that he\nthinks it would have been nicer if the file the patch adds were\nnamed gitcommit.vim, not commit-syntax.vim.  As you seem to\nagree that the preferred name for this file when deployed is\ngitcommit.vim, how about something like this on top of your\npatch perhaps?\n\n\ndiff --git a/contrib/vim/README b/contrib/vim/README\nindex bad0a05..f574cc8 100644\n--- a/contrib/vim/README\n+++ b/contrib/vim/README\n@@ -1,6 +1,6 @@\n To syntax highlight git's commit messages, you need to:\n-  1. Copy commit-syntax.vim to vim's syntax directory:\n-     $ cp commit-syntax.vim $HOME/.vim/syntax/gitcommit.vim\n+  1. Copy gitcommit.vim to vim's syntax directory:\n+     $ cp gitcommit.vim $HOME/.vim/syntax/\n   2. Auto-detect the editing of git commit files:\n      $ cat >>$HOME/.vimrc <<'EOF'\n      autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit\ndiff --git a/contrib/vim/commit-syntax.vim b/contrib/vim/gitcommit.vim\nsimilarity index 100%\nrename from contrib/vim/commit-syntax.vim\nrename to contrib/vim/gitcommit.vim\n"},{"id":"26788","messageId":"20060913062557.GA4783@coredump.intra.peff.net","threadId":"5539","inReplyTo":"7vy7so9txj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] contrib/vim: add syntax highlighting file for commits","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2006-09-13T06:25:57Z","receivedAt":"2006-09-13T06:25:57Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Sep 12, 2006 at 11:12:08PM -0700, Junio C Hamano wrote:\n\n> I am not a vim user, but my reading of Tom's comment is that he\n> thinks it would have been nicer if the file the patch adds were\n> named gitcommit.vim, not commit-syntax.vim.  As you seem to\n> agree that the preferred name for this file when deployed is\n> gitcommit.vim, how about something like this on top of your\n> patch perhaps?\n\nMy point was that there may be many files named gitcommit.vim; the\ndirectory they appear in under your .vim directory has significance. If\nwe add another such file, they will conflict in the flattened namespace\nof contrib/vim.  See below (which also adds the necessary mkdir\ncommand):\n\n-- >8 --\ncontrib/vim: give commit-syntax a more sensible name\n\ndiff --git a/contrib/vim/README b/contrib/vim/README\nindex bad0a05..9e7881f 100644\n--- a/contrib/vim/README\n+++ b/contrib/vim/README\n@@ -1,6 +1,7 @@\n To syntax highlight git's commit messages, you need to:\n-  1. Copy commit-syntax.vim to vim's syntax directory:\n-     $ cp commit-syntax.vim $HOME/.vim/syntax/gitcommit.vim\n+  1. Copy syntax/gitcommit.vim to vim's syntax directory:\n+     $ mkdir -p $HOME/.vim/syntax\n+     $ cp syntax/gitcommit.vim $HOME/.vim/syntax\n   2. Auto-detect the editing of git commit files:\n      $ cat >>$HOME/.vimrc <<'EOF'\n      autocmd BufNewFile,BufRead COMMIT_EDITMSG set filetype=gitcommit\ndiff --git a/contrib/vim/commit-syntax.vim b/contrib/vim/syntax/gitcommit.vim\nsimilarity index 100%\nrename from contrib/vim/commit-syntax.vim\nrename to contrib/vim/syntax/gitcommit.vim\n"},{"id":"26789","messageId":"20060913064640.GA3731@socrates.priv","threadId":"5539","inReplyTo":"20060913062557.GA4783@coredump.intra.peff.net","subject":"Re: [PATCH] contrib/vim: add syntax highlighting file for commits","fromName":"Tom Prince","fromEmail":"tom.prince@ualberta.net","sentAt":"2006-09-13T06:46:40Z","receivedAt":"2006-09-13T06:46:40Z","isPatch":true,"sender":{"key":"tom.prince@ualberta.net","avatar":"https://gravatar.com/avatar/a0ad19caee7618876339485106ec994f5202505eecd210ba5c0bd869feaa555a?d=mp&s=160"},"body":"On Wed, Sep 13, 2006 at 02:25:57AM -0400, Jeff King wrote:\n \n> My point was that there may be many files named gitcommit.vim; the\n> directory they appear in under your .vim directory has significance. If\n> we add another such file, they will conflict in the flattened namespace\n> of contrib/vim.  See below (which also adds the necessary mkdir\n> command):\n> \n\nMuch clearer. I had glanced at the readme and did\ncp commit-syntax.vim ~/.vim/syntax\nand it took me a minute or so to figure what was wrong.\n\n  Tom\n"}]}