Re: [BUG] - "git commit --amend" commits, when exiting the editor with no changes written

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

 



On Tue, Feb 02, 2010 at 07:55:31PM -0500, Eugene Sajine wrote:
> On Tue, Feb 2, 2010 at 7:16 PM, Erik Faye-Lund <kusmabite@xxxxxxxxxxxxxx> wrote:
> > On Wed, Feb 3, 2010 at 12:48 AM, Eugene Sajine <euguess@xxxxxxxxx> wrote:
> >>>
> >>> This is where you're wrong. The reason why commit (without --amend) is
> >>> aborting when you don't save is that the default commit message is
> >>> empty, not that it wasn't saved. In fact, just saving still makes in
> >>> abort. You need to add something to the commit message and then save
> >>> to get it to perform the commit.
> >>>
> >>>> Same should be applied to rebase -i and of course to commit --amend as
> >>>> it is still commit operation.
> >>>>
> >>>
> >>> "rebase -i" and "commit --amend" already has the exact same logic as
> >>> commit without ammend in this regard - they abort if the buffer is
> >>> empty.
> >>>
> >>> --
> >>> Erik "kusma" Faye-Lund
> >>>
> >>
> >> Thank you, but I'm not wrong, as i described the exact same thing
> >> somewhere in my second or third message, without even knowing the
> >> implementation details. I understand the reason WHY it is like it is,
> >> i just don't like it as it is inconsistent and IMHO incorrect.
> >>
> >
> > But you are. The interface isn't inconsistent. Your model of how it
> > works however, is wrong.
> >
> > --
> > Erik "kusma" Faye-Lund
> >
> 
> I'm sorry, but I don't get in which part my model is so wrong? The only
> difference i see between your and my explanation is that you mentioned the
> fact that simply saving the pregenerated new commit message is not working
> because there is no meaningful (uncommented) string inserted into the
> template. But this
> doesn't change the problem it self, so I don't think it is relevant.
> 
> What is relevant though is that in current workflow with "rebase -i"
> you have to remove! all
> commits listed for rebase and save! the file in order to cancel! rebase
> operation. This is very strange user interaction model IMHO
> 
> Instead of being explicit in applying the changes, we are explicit in
> cancelling the operation. Very strange...

No.  In case of rebase -i, exiting the editor is being explicit in
"the todo file now contains what you should do, so do it".  And if the
todo file happens to be empty, then there is nothing to do, so do
nothing.  The same applies to commit and commit --amend: exiting the
editor is being explicit in "the COMMIT_MSG file now contains what you
should put in the commit message".  But not having a commit message is
a really bad idea, therefore git complains and doesn't do that (unless
overridden by some command line option).


Best,
Gábor

--
To unsubscribe from this list: 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]