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

Re: Please add support for "git merge --continue -S"

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 28, 2022, 22:53 UTC
Message-ID
<xmqq1qzmy55g.fsf@gitster.g>
In-Reply-To
<220228.86fso35k61.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 5 quoted lines
> You can just drop the use of "merge --continue" entirely and use
> "commit" instead.
>
> Caveats related to this were recently discussed on-list:
> https://lore.kernel.org/git/CALRdAfcyfesNqfLhhe2GW_5V9s2hf++i6mZS1Lw5hqQYTca85w@mail.gmail.com/

Ah, that one. We need to close the #leftoverbits on the topic. Here is a starter.

----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
Subject: merge: 'git merge --continue' is merely 'git commit'

Among the commands with "--continue", "merge --continue" came much later, and it did not even need to exist. The other commands with "--continue", e.g. "rebase", deal with multi-step operations, and it is worth to have a way to say "I am finished with this step, let's CONTINUE WITH THE REST". But in "merge", there is no remaining thing to do after you are done with the conflict you saw.

In hindsight, we probably should have resisted the urge to add "merge --continue", just for the sake of misguided "consistency" perceived on non-existent similarity with other commands that truly need "--continue". What is called "merge --continue" should have been called "merge --finish", if we needed to add something back then.

The way to finish a conflicted merge has always been to run "git commit" before "merge --continue" was added, and it still is not just accepted but is the right way to finish a conflicted merge.

There is an argument that it makes it somehow "safer" to use "merge --continue" because the command fails when there is no interrupted merge going on, but what the user sees from "git commit" when there is and there is not interrupted merge are so different, there is not much "safety" benefit in practice. We probably should deprecate and eventually remove "git merge --continue" eventually, but one step at a time.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/git-merge.txt | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff --git c/Documentation/git-merge.txt w/Documentation/git-merge.txt
index 3125473cc1..95f252598e 100644
--- c/Documentation/git-merge.txt
+++ w/Documentation/git-merge.txt
@@ -122,9 +122,9 @@ list.
 	stash entry will be saved to the stash list.
 
 --continue::
-	After a 'git merge' stops due to conflicts you can conclude the
-	merge by running 'git merge --continue' (see "HOW TO RESOLVE
-	CONFLICTS" section below).
+	After a 'git merge' stops due to conflicts, you can conclude
+	the merge with "git commit" (see "HOW TO RESOLVE CONFLICTS"
+	section below).  'git merge --continue' is a synonym for it.
 
 <commit>...::
 	Commits, usually other branch heads, to merge into our branch.
@@ -326,10 +326,9 @@ After seeing a conflict, you can do two things:
 
  * Resolve the conflicts.  Git will mark the conflicts in
    the working tree.  Edit the files into shape and
-   'git add' them to the index.  Use 'git commit' or
-   'git merge --continue' to seal the deal. The latter command
-   checks whether there is a (interrupted) merge in progress
-   before calling 'git commit'.
+   'git add' them to the index.  Use 'git commit' (or
+   'git merge --continue', which stops if there is no 
+   interrupted merge in progress) to seal the deal.
 
 You can work through the conflict with a number of tools:
 
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 3 of 4 in “Please add support for "git merge --continue -S"”
  1. Rolf Eike BeerFeb 28, 2022
  2. Ævar Arnfjörð BjarmasonFeb 28, 2022
  3. Junio C HamanoFeb 28, 2022
  4. Ævar Arnfjörð BjarmasonFeb 28, 2022

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.