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 2, 2010 at 5:35 PM, Avery Pennarun <apenwarr@xxxxxxxxx> wrote:
>> amend or rebase:
>> COMMIT_EDITMSG = "message from commit or rebase sequence";
>> $ git commit --amend
>>
>> in background:
>> $EDITOR .git/COMMIT_EDITMSG
>>
>> COMMIT_EDITMSG = NULL    <======== this i think is missing. We have to
>> clean it after it is populated in the editor.
>
> That's not going to work.  Most editors will get quite angry at you if
> you modify the file while the editor has it open.  Furthermore, how do
> you know how long to wait after launching the editor but before
> deleting the file?

I'm not insisting on this approach by any mean - i was trying to
explain what is the problem i consider to be a bug.


>
> Like I suggested earlier, monitoring the mtime of the file to see if
> it has changed after the editor exits, even if the file itself is
> identical to what it was, might work.

Anything that would work;)

>This feature would have to be
> optional in order to not confuse existing users, and not annoy users
> of editors (like my favourite, joe) which don't save-on-exit if the
> file hasn't changed.  But I think it might be valuable to some people
> nevertheless.  And if it became popular, perhaps it could become the
> default in some future version of git (after giving people enough
> notice, etc, etc).

But here I totally disagree, because i don't understand what is so new
and confusing in the workflow I'm talking about?
Why you're not confused that you MUST save before exiting your EDITOR
in order to be able to commit (else it will fail), but the same
workflow suddenly becomes confusing when you doing "commit --amend" or
especially "rebase -i" ???

Frankly, I think that "rebase -i" is the best example when exiting
without save should abort, not proceed.


>
> So you might want to submit a patch to implement an option like that.
>
> Avery
>

I wish i could - but, unfortunately, I'm as far from C as from the Sun
(star;)). I'm developing a little bit in Java, but can't do C.

Thanks,
Eugene
--
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]