motemen / git-vim

My vim files for Git
575 stars 73 forks source link

Use BufDelete or similar instead of BufWritePost in :GitCommit #7

Closed wincent closed 8 years ago

wincent commented 15 years ago

When writing a lengthy commit message you might want to save the buffer occasionally out of habit, but if you do you'll find that a commit takes place and your half-written commit message got included.

To avoid this, I think it would be a good idea if the BufWritePost autocmd in the :GitCommit implementation were changed to BufDelete or similar.

It would also match the behaviour of the command line when you have EDITOR=vim (or any other editor) in your environment and do a "git commit": the actual commit is only processed when you exit the editor, not when you save the message.

wincent commented 15 years ago

If you want to cherry pick, the suggested change is here:

wincent/git-vim@a5a8264bf1bb90ae80732b877708c9d5097b1d9c

wincent commented 15 years ago

Hyperlink: http://github.com/wincent/git-vim/commit/a5a8264bf1bb90ae80732b877708c9d5097b1d9c