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]

 



>
> As has already been pointed out, an extremely common workflow for "git
> commit --amend" is to include additional changes that were accidentally
> overlooked  in the initial commit, and no changes are made to the commit
> message.
>
> Changing the behavior would break that perfectly reasonable,
> widely-practised workflow, and _that_ would be 100% not ok.

I'm not against that workflow - I'm not forcing anybody to change the
commit message. The thing I'm talking about is roughly that it should
NOT treat the result of command ":q" the same way as the command
":wq".

For example IF there is a variable somewhere where message is stored:
For new commit message it is NULL and when commit is ready it is set
up to "message". We check If it is not empty and not NULL (:wq
executed),  then we can commit.
For "prepopulated" messages this variable can be is set to "message"
from the beginning, so it doesn't matter if you're writing changes or
not the check will always be true, so we can commit.
If the implementation would be like this, then I would propose to
clean up this variable after the prepopulated message is populated, so
it won't use it blindly, but only after you're overwriting the message
(even if the message is not changed).
--
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]