git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Elijah Newren <newren@gmail.com>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Kevin Daudt <me@ikke.info>, Git Mailing list <git@vger.kernel.org>
Subject: Re: why does "git revert" commit even if i try to bail with ":q!"?
Date: Tue, 12 Mar 2019 11:24:38 -0700	[thread overview]
Message-ID: <CABPp-BHV9+7+3si8NOA0ouYZ_Zyo5yMqMbSggwoYmRLK-kB_dA@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.21.1903121419070.18042@localhost.localdomain>

On Tue, Mar 12, 2019 at 11:21 AM Robert P. J. Day <rpjday@crashcourse.ca> wrote:
>
> On Tue, 12 Mar 2019, Kevin Daudt wrote:
>
> ... snip ...
>
> > The only reason why `:q!` works just for comitting is because there
> > is no default message, so the final message ends up empty.
> >
> > When you do things like git revert or git commit --amend, there is
> > already a commit message, which you are then editing. When you quit
> > without saving, the existing message remains and git uses that.
> >
> > vim has a command to let it exit with an error return code: `:cq`.
> > This makes git something went wrong with editing the message,
> > causing git to abort the commit.
>
>   ah, i'm starting to get it. predictably, i think this needs to be
> mentioned in a man page. :-) thanks muchly for clearing that up.

If you do fix up some manpage, note that this affects e.g. commit
--amend too as pointed out by Kevin (and maybe also the 'reword'
option of git-rebase?) -- anything that starts with .git/COMMIT_MSG
being non-empty.

      reply	other threads:[~2019-03-12 18:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 17:22 why does "git revert" commit even if i try to bail with ":q!"? Robert P. J. Day
2019-03-12 17:53 ` Bryan Turner
2019-03-12 18:01   ` Robert P. J. Day
2019-03-12 18:19     ` Bryan Turner
2019-03-12 18:22       ` Robert P. J. Day
2019-03-12 18:14   ` Robert P. J. Day
2019-03-12 18:20     ` SZEDER Gábor
2019-03-12 18:20     ` Bryan Turner
2019-03-12 18:14 ` Kevin Daudt
2019-03-12 18:20   ` Robert P. J. Day
2019-03-12 18:24     ` Elijah Newren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BHV9+7+3si8NOA0ouYZ_Zyo5yMqMbSggwoYmRLK-kB_dA@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@ikke.info \
    --cc=rpjday@crashcourse.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).