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

git 2.24: git revert <commit1> <commit2> requires extra '--continue'?

From
BNBrian Norris <briannorris@chromium.org>
Date
Nov 22, 2019, 23:10 UTC
Message-ID
<CA+ASDXNQ+9i-6uCNDwN46cnHJeciiqQSX5Z6EaqB9pbseQhVFw@mail.gmail.com>

Hi! I'm using git 2.24 (or, a variant of that packaged my distro -- I can try to build my own if this is deemed not reproducible), and I feel like I've been seeing a regression here:

Previously, when reverting multiple commits (with the default --edit behavior), as soon as I'm done editing the first revert commit message, the second revert commit pops up an editor, and I'm on my way. Now, it seems to require an extra 'git revert --continue' prompt in between, yet it doesn't actually recommend that. This is highly confusing, and seemingly unnecessary.

An annotated transcript provided below.

Note that none of this happens with --no-edit; my reverts happen smoothly, with no extra need for --continue.

Regards, Brian

$ mkdir tmp
$ cd tmp
/tmp$ git init
Initialized empty Git repository in [...]/tmp/.git/
/tmp$ touch foo
/tmp$ git add foo
/tmp$ echo bar >> foo
/tmp$ git commit -am baz
[master (root-commit) a388f78d9013] baz
 1 file changed, 1 insertion(+)
 create mode 100644 foo
/tmp$ echo pow >> foo
/tmp$ git commit -am whizzbang
[master 51753222dd9a] whizzbang
 1 file changed, 1 insertion(+)
/tmp$ echo pop >> foo
/tmp$ git commit -am nothing
[master 7153607b11e0] nothing
 1 file changed, 1 insertion(+)
/tmp$ git revert HEAD HEAD^
## EDITOR pops up, as expected
[master 586469974ec2] Revert "nothing"
 1 file changed, 1 deletion(-)
On branch master
Revert currently in progress.
nothing to commit, working tree clean
## Unexpected, confusing pause? No prompt to '--continue'
/tmp$ git log --oneline
586469974ec2 (HEAD -> master) Revert "nothing"
7153607b11e0 nothing
51753222dd9a whizzbang
a388f78d9013 baz
/tmp$ git status
On branch master
Revert currently in progress.
  (run "git revert --continue" to continue)
  (use "git revert --skip" to skip this patch)
  (use "git revert --abort" to cancel the revert operation)
nothing to commit, working tree clean
/tmp$ git revert --continue
## EDITOR pops up, as expected
[master b8dd23f61d07] Revert "whizzbang"
 1 file changed, 1 deletion(-)
On branch master
Revert currently in progress.
nothing to commit, working tree clean
## Unexpected state; both reverts happened, but revert is still in progress?
/tmp$ git log --oneline
b8dd23f61d07 (HEAD -> master) Revert "whizzbang"
586469974ec2 Revert "nothing"
7153607b11e0 nothing
51753222dd9a whizzbang
a388f78d9013 baz
/tmp$ git status
On branch master
Revert currently in progress.
  (run "git revert --continue" to continue)
  (use "git revert --skip" to skip this patch)
  (use "git revert --abort" to cancel the revert operation)

nothing to commit, working tree clean ## OK...I'll run it one more time. /tmp$ git revert --continue /tmp$ git status On branch master nothing to commit, working tree clean ## *Now* I'm done /tmp$ git log --oneline b8dd23f61d07 (HEAD -> master) Revert "whizzbang" 586469974ec2 Revert "nothing" 7153607b11e0 nothing 51753222dd9a whizzbang a388f78d9013 baz

Next: SZEDER Gábor
Message 1 of 16 in “git 2.24: git revert <commit1> <commit2> requires extra '--continue'?”
  1. Brian NorrisNov 22, 2019
  2. SZEDER GáborNov 23, 2019
  3. Phillip WoodNov 23, 2019
  4. sequencer: don't re-read todo for revert and cherry-pickSZEDER Gábor, Nov 23, 2019
  5. Johannes SchindelinNov 23, 2019
  6. Junio C HamanoNov 24, 2019
  7. Phillip WoodNov 24, 2019
  8. t3429: try to protect against a potential racy todo file problemSZEDER Gábor, Nov 24, 2019
  9. Junio C HamanoNov 25, 2019
  10. SZEDER GáborNov 25, 2019
  11. SZEDER GáborNov 25, 2019
  12. Phillip WoodNov 25, 2019
  13. SZEDER GáborNov 25, 2019
  14. Phillip WoodNov 25, 2019
  15. Junio C HamanoNov 25, 2019
  16. Phillip WoodNov 25, 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.