git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: why does "git revert" commit even if i try to bail with ":q!"?

From
Robert P. J. Day <rpjday@crashcourse.ca>
Date
Mar 12, 2019, 18:20 UTC
Message-ID
<alpine.LFD.2.21.1903121419070.18042@localhost.localdomain>
In-Reply-To
<20190312181428.GA6993@alpha>
On Tue, 12 Mar 2019, Kevin Daudt wrote:
... snip ...
Show 10 quoted lines
> 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.
rday
-- 
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
Previous: Kevin DaudtNext: Elijah Newren
Message 10 of 11 in “why does "git revert" commit even if i try to bail with ":q!"?”
  1. Robert P. J. DayMar 12, 2019
  2. Bryan TurnerMar 12, 2019
  3. Robert P. J. DayMar 12, 2019
  4. Bryan TurnerMar 12, 2019
  5. Robert P. J. DayMar 12, 2019
  6. Robert P. J. DayMar 12, 2019
  7. SZEDER GáborMar 12, 2019
  8. Bryan TurnerMar 12, 2019
  9. Kevin DaudtMar 12, 2019
  10. Robert P. J. DayMar 12, 2019
  11. Elijah NewrenMar 12, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.