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

[PATCH] rebase -i: permit 'drop' of a merge commit

From
Johannes Sixt <j6t@kdbg.org>
Date
Aug 6, 2025, 17:38 UTC
Message-ID
<37f6e34c-91aa-4e55-88e1-019d2e042df3@kdbg.org>

4c063c82e9 (rebase -i: improve error message when picking merge, 2024-05-30) added advice texts for cases when a merge commit is passed as argument of sequencer command that cannot operate with a merge commit. However, it forgot about the 'drop' command, so that in this case the BUG() in the default branch is reached.

Handle 'drop' like 'merge', i.e., permit it without a message.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
 sequencer.c                   | 1 +
 t/t3404-rebase-interactive.sh | 1 +
 2 files changed, 2 insertions(+)
diff --git a/sequencer.c b/sequencer.c
index aaf2e4df64..9ae40a91b2 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2720,8 +2720,9 @@ static int check_merge_commit_insn(enum todo_command command)
 	case TODO_SQUASH:
 		return error(_("cannot squash merge commit into another commit"));
 
 	case TODO_MERGE:
+	case TODO_DROP:
 		return 0;
 
 	default:
 		BUG("unexpected todo_command");
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 6bac217ed3..34d6ad0770 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -2262,8 +2262,9 @@ rebase_setup_and_clean () {
 	reword $oid
 	edit $oid
 	fixup $oid
 	squash $oid
+	drop $oid # acceptable, no advice
 	EOF
 	(
 		set_replace_editor todo &&
 		test_must_fail git rebase -i HEAD 2>actual
-- 
2.50.1.837.g8c5950ae16
Next: Junio C Hamano
Message 1 of 4 in “rebase -i: permit 'drop' of a merge commit”
  1. rebase -i: permit 'drop' of a merge commitJohannes Sixt, Aug 6, 2025
  2. Junio C HamanoAug 6, 2025
  3. Phillip WoodAug 7, 2025
  4. Phillip WoodAug 7, 2025

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.