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

Re: Thoughts on adding another hook to git

From
Nikolai Weibull <now@bitwi.se>
Date
Jun 13, 2006, 15:26 UTC
Message-ID
<dbfc82860606130826jd9ba61fx26d0b3e42d68c93a@mail.gmail.com>
In-Reply-To
<448EB7B6.4020708@shlrm.org>
On 6/13/06, David Kowis <dkowis@shlrm.org> wrote:
> I'm using vim.
Show 12 quoted lines
>   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
Previous: David KowisNext: Junio C Hamano
Message 8 of 9 in “Thoughts on adding another hook to git”
  1. David KowisJun 12, 2006
  2. Yakov LernerJun 12, 2006
  3. David KowisJun 12, 2006
  4. Yakov LernerJun 12, 2006
  5. David KowisJun 12, 2006
  6. Nikolai WeibullJun 13, 2006
  7. David KowisJun 13, 2006
  8. Nikolai WeibullJun 13, 2006
  9. Junio C HamanoJun 13, 2006

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.