Re: [BUG] - "git commit --amend" commits, when exiting the editor with no changes written
- From
Paolo Bonzini <bonzini@gnu.org>
- Date
- Feb 3, 2010, 09:46 UTC
- Message-ID
- <hkbgli$tqt$1@ger.gmane.org>
- In-Reply-To
- <76c5b8581002021609i4c05d039k35979757fbb74676@mail.gmail.com>
On 02/03/2010 01:09 AM, Eugene Sajine wrote:
Show 5 quoted lines
>> Sorry, your "if message was not saved, abort" is so out of line with any >> program I use that this would be highly confusing (maybe "complicated" was >> the wrong choice of words). > > Frankly, i think it is in line with "git commit"
The fundamental problem is this. The behavior of "git commit" can be explained in two ways: a) abort if not saved; b) abort if empty. (a) may be an easier guess from experience (you type ":q!" at the vi prompt), but (b) is clear from the error message ("commit has empty message--aborting"). All this is irrefutable.
Now, the scientific method to see which one is correct, would be to try other commands including "git commit --amend" and see which of the two hypotheses was right. It turns out to be that (b) is correct and consistent across various commands; instead you insist that everything else should be modified to conform to (a). Since git is already consistent, and since nobody can think of a way to implement your proposal, there is obvious resistence to any change in this area.
Paolo