* commit --amend neglecting return value
@ 2010-03-22 4:36 maximilian attems
2010-03-22 5:16 ` Brian Gernhardt
0 siblings, 1 reply; 4+ messages in thread
From: maximilian attems @ 2010-03-22 4:36 UTC (permalink / raw)
To: git
hello,
bug is easily reproducible by
> foo
git add foo
git commit --amend
:q!
1 files changed, 1 insertions(+), 8 deletions(-)
create mode 100644 test
git --version
git version 1.7.0.2
aboves is usage with vim as patch editor.
The expected behaviour would be to have not foo add to repo.
afair this feature^Wbug exists since loooong.
thanks + kind regards
--
maks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: commit --amend neglecting return value
2010-03-22 4:36 commit --amend neglecting return value maximilian attems
@ 2010-03-22 5:16 ` Brian Gernhardt
2010-03-22 5:20 ` Brian Gernhardt
0 siblings, 1 reply; 4+ messages in thread
From: Brian Gernhardt @ 2010-03-22 5:16 UTC (permalink / raw)
To: maximilian attems; +Cc: git
On Mar 22, 2010, at 12:36 AM, maximilian attems wrote:
> bug is easily reproducible by
>
>> foo
> git add foo
> git commit --amend
> :q!
> 1 files changed, 1 insertions(+), 8 deletions(-)
> create mode 100644 test
>
> git --version
> git version 1.7.0.2
>
> aboves is usage with vim as patch editor.
> The expected behaviour would be to have not foo add to repo.
> afair this feature^Wbug exists since loooong.
Vim returns 0 even if quit with :q!. Killing vim from another terminal causes this:
--- 8< ---
Vim: Caught deadly signal TERM
Vim: Finished.
error: /Users/brian/bin/vim died of signal 15
error: There was a problem with the editor '/Users/brian/bin/vim'.
Please supply the message using either -m or -F option.
--- 8< ---
If you want to abort committing while editing the message, delete the entire message (in Vim: "0dG:wq^M") and git will reply "Aborting commit due to empty commit message."
~~ Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: commit --amend neglecting return value
2010-03-22 5:16 ` Brian Gernhardt
@ 2010-03-22 5:20 ` Brian Gernhardt
2010-03-22 18:39 ` maximilian attems
0 siblings, 1 reply; 4+ messages in thread
From: Brian Gernhardt @ 2010-03-22 5:20 UTC (permalink / raw)
To: Brian Gernhardt; +Cc: maximilian attems, git
On Mar 22, 2010, at 1:16 AM, Brian Gernhardt wrote:
> If you want to abort committing while editing the message, delete the entire message (in Vim: "0dG:wq^M") and git will reply "Aborting commit due to empty commit message."
Oops. Obviously I meant "ggdG:wq^M".
Also, a quick search of :help and testing reveals that ":cq" causes Vim to exit with non-zero status which will cause git to abort the commit.
~~ Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: commit --amend neglecting return value
2010-03-22 5:20 ` Brian Gernhardt
@ 2010-03-22 18:39 ` maximilian attems
0 siblings, 0 replies; 4+ messages in thread
From: maximilian attems @ 2010-03-22 18:39 UTC (permalink / raw)
To: Brian Gernhardt; +Cc: git
On Mon, 22 Mar 2010, Brian Gernhardt wrote:
>
> On Mar 22, 2010, at 1:16 AM, Brian Gernhardt wrote:
>
> > If you want to abort committing while editing the message, delete the entire message (in Vim: "0dG:wq^M") and git will reply "Aborting commit due to empty commit message."
>
> Oops. Obviously I meant "ggdG:wq^M".
>
> Also, a quick search of :help and testing reveals that ":cq" causes Vim to exit with non-zero status which will cause git to abort the commit.
thanks for the pointer this is indeed very helpful. :)
kept hiting that bug in stressy situations, good to know a way out.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-03-23 0:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 4:36 commit --amend neglecting return value maximilian attems
2010-03-22 5:16 ` Brian Gernhardt
2010-03-22 5:20 ` Brian Gernhardt
2010-03-22 18:39 ` maximilian attems
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).