Re: Thoughts on adding another hook to git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/13/06, David Kowis <dkowis@xxxxxxxxx> wrote:
I'm using vim.

  1 # Explicit paths specified without -i nor -o; assuming --only paths...
  2 #
  3 # Updated but not checked in:
  4 #   (will commit)
  5 #
  6 #   modified: mail/abook/DETAILS
  7 #   modified: mail/abook/HISTORY

What I'd like to be able to do is have that "abook" directory name
automatically added to the top of my commit message before it gets into
the editor. I can do this with a script (echo ${PWD##*/}) but it'd need
to be a hook before the editor shows up.

autocmd BufRead .git/COMMIT_MSG call setline(1, expand('%:p:h:h:t'))

But that will of course do that for all commit-messages, so your point
is still valid.

 nikolai
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]