Re: [BUG] - "git commit --amend" commits, when exiting the editor with no changes written
- From
Avery Pennarun <apenwarr@gmail.com>
- Date
- Feb 2, 2010, 21:18 UTC
- Message-ID
- <32541b131002021318q4e25967dp8ed001b0fb92b2ae@mail.gmail.com>
- In-Reply-To
- <76c5b8581002021247j6df8f609ld9e5d87a060a5423@mail.gmail.com>
On Tue, Feb 2, 2010 at 3:47 PM, Eugene Sajine <euguess@gmail.com> wrote:
Show 10 quoted lines
> If you're just exiting the vi using :q without writing changes it will > perform rebase! I'm 100% sure it is not OK. > > So, it seems that it will do that every time it has some > *prepopulated* message in the editor, so it doesn't understand when > changes are written and when they are not. > > I believe all those actions should be treated exactly the same way as > the commit itself. If I'm writing/saving changes - it is good to go. > If not - abort.
It might be sort of neat to check the mtime of the commit message file before and after launching the editor; then if you want, you could force-save the file even without any changes, and git would know that you want it changed.
Not sure I would like that behaviour better than the current way, actually, but it's an idea.
Avery