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

[PATCH 1/2] rebase: help user when dying with preserve-merges`

From
Philip Oakley via GitGitGadget <gitgitgadget@gmail.com>
Date
Feb 22, 2022, 10:33 UTC
Message-ID
<cd06aa68c2fc65551cd810a1c2c0941c51433163.1645526016.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1155.git.1645526016.gitgitgadget@gmail.com>
From: Philip Oakley <philipoakley@iee.email>

Git will die if a "rebase --preserve-merges" is in progress. Users cannot --quit, --abort or --continue the rebase.

This sceario can occur if the user updates their Git, or switches to another newer version, after starting a preserve-merges rebase, commonly via the pull setting.

One trigger is an unexpectedly difficult to resolve conflict, as reported on the `git-users` group. (https://groups.google.com/g/git-for-windows/c/3jMWbBlXXHM)

Tell the user the cause, i.e. the existence of the directory. The problem must be resolved manually, `git rebase --<option>` commands will die, or the user must downgrade. Also, note that the deleted options are no longer shown in the documentation.

Signed-off-by: Philip Oakley <philipoakley@iee.email>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/rebase.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index d858add3fe8..07221d0ae41 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1181,7 +1181,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 		strbuf_reset(&buf);
 		strbuf_addf(&buf, "%s/rewritten", merge_dir());
 		if (is_directory(buf.buf)) {
-			die("`rebase -p` is no longer supported");
+			die("`rebase --preserve-merges` (-p) is no longer supported.\n"
+			"You still have a `.git/rebase-merge/rewritten` directory, \n"
+			"indicating a `rebase preserve-merge` is still in progress.\n");
 		} else {
 			strbuf_reset(&buf);
 			strbuf_addf(&buf, "%s/interactive", merge_dir());
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Ævar Arnfjörð Bjarmason
Message 2 of 18 in “Update the die() preserve-merges messages to help some users”
  1. 0/2 Update the die() preserve-merges messages to help some usersJohannes Schindelin via GitGitGadget, Feb 22, 2022
  2. 1/2 rebase: help user when dying with preserve-merges`Philip Oakley via GitGitGadget, Feb 22, 2022
  3. Ævar Arnfjörð BjarmasonFeb 22, 2022
  4. Philip OakleyFeb 22, 2022
  5. Ævar Arnfjörð BjarmasonFeb 23, 2022
  6. Philip OakleyFeb 23, 2022
  7. Ævar Arnfjörð BjarmasonMar 8, 2022
  8. 2/2 rebase: `preserve` is also a pull option, tell dying usersPhilip Oakley via GitGitGadget, Feb 22, 2022
  9. Ævar Arnfjörð BjarmasonFeb 22, 2022
  10. Philip OakleyFeb 22, 2022
  11. Philip OakleyFeb 22, 2022
  12. Ævar Arnfjörð BjarmasonFeb 23, 2022
  13. Philip OakleyMar 4, 2022
  14. Johannes SchindelinMar 7, 2022
  15. Philip OakleyMar 7, 2022
  16. Johannes SchindelinMar 9, 2022
  17. Phillip WoodFeb 22, 2022
  18. Philip OakleyFeb 22, 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.