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

[BUG?] git-revert ignores --no-commit on conflicts

From
FBFlorian Bruhin <me@the-compiler.org>
Date
Apr 1, 2014, 13:24 UTC
Message-ID
<20140401132454.GQ9499@lupin>
Hi,

I found something which seems to be a bug to me (or well, maybe I'm doing something wrong...). When I revert a commit with -n/--no-commit and there's a conflict, when doing "git revert --continue" I get an editor, even though I wouldn't expect that to happen.

Example:
    $ git init
    Initialized empty Git repository in [...]
    $ echo foo > file
    $ git add file
    $ git commit -m "Initial commit"
    [master (root-commit) 9f8e5fb] Initial commit
     1 file changed, 1 insertion(+)
     create mode 100644 file
    $ echo bar > file
    $ git commit -am "foo -> bar"
    [master e53d99f] foo -> bar
     1 file changed, 1 insertion(+), 1 deletion(-)
    $ echo baz > file
    $ git commit -am "bar -> baz"
    [master fa3c23f] bar -> baz
     1 file changed, 1 insertion(+), 1 deletion(-)
    $ git revert -n HEAD  # this works as expected
    $ git revert --abort
    $ git revert -n e53d99f  # reverting the middle commit to provoke a conflict
    error: could not revert e53d99f... foo -> bar
    hint: after resolving the conflicts, mark the corrected paths
    hint: with 'git add <paths>' or 'git rm <paths>'
    $ echo fish > file
    $ git add file
    $ git revert --continue  # here my editor opens
    Aborting commit due to empty commit message.
Tested using git 1.9.1 and 1.9.0.msysgit.0.
Florian
-- 
() ascii ribbon campaign - stop html mail    www.asciiribbon.org
/\ www.the-compiler.org  | I love long mails http://email.is-not-s.ms/
Love is never asking why? 
Message 1 of 1 in “[BUG?] git-revert ignores --no-commit on conflicts”
  1. Florian BruhinApr 1, 2014

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.