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

[PATCH 2/2] git: mark cmd_rebase as requiring a worktree

From
Johannes Schindelin via GitGitGadget <gitgitgadget@gmail.com>
Date
Jul 24, 2019, 21:15 UTC
Message-ID
<bee82eb36f8dc1bd7d31d4db763d0d0e1b0a4b84.1564002897.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.293.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>

We skipped marking the "rebase" built-in as requiring a .git/ directory and a worktree only to allow to spawn the scripted version of `git rebase`.

Now that we no longer have that escape hatch, we can change that to the canonical form.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 builtin/rebase.c | 4 ----
 git.c            | 7 +------
 2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 798b9ae2d7..b33ec9c7c0 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1481,10 +1481,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 		usage_with_options(builtin_rebase_usage,
 				   builtin_rebase_options);
 
-	prefix = setup_git_directory();
-	trace_repo_setup(prefix);
-	setup_work_tree();
-
 	options.allow_empty_message = 1;
 	git_config(rebase_config, &options);
 
diff --git a/git.c b/git.c
index 1bf9c94550..1461e819c3 100644
--- a/git.c
+++ b/git.c
@@ -549,12 +549,7 @@ static struct cmd_struct commands[] = {
 	{ "push", cmd_push, RUN_SETUP },
 	{ "range-diff", cmd_range_diff, RUN_SETUP | USE_PAGER },
 	{ "read-tree", cmd_read_tree, RUN_SETUP | SUPPORT_SUPER_PREFIX},
-	/*
-	 * NEEDSWORK: Until the rebase is independent and needs no redirection
-	 * to rebase shell script this is kept as is, then should be changed to
-	 * RUN_SETUP | NEED_WORK_TREE
-	 */
-	{ "rebase", cmd_rebase },
+	{ "rebase", cmd_rebase, RUN_SETUP | NEED_WORK_TREE },
 	{ "rebase--interactive", cmd_rebase__interactive, RUN_SETUP | NEED_WORK_TREE },
 	{ "receive-pack", cmd_receive_pack },
 	{ "reflog", cmd_reflog, RUN_SETUP },
-- 
gitgitgadget
Previous: Johannes Schindelin via GitGitGadgetNext: Junio C Hamano
Message 3 of 5 in “Clean up more of the fall-out from dropping the scripted git rebase”
  1. 0/2 Clean up more of the fall-out from dropping the scripted git rebaseJohannes Schindelin via GitGitGadget, Jul 24, 2019
  2. 1/2 rebase: fix white-spaceJohannes Schindelin via GitGitGadget, Jul 24, 2019
  3. 2/2 git: mark cmd_rebase as requiring a worktreeJohannes Schindelin via GitGitGadget, Jul 24, 2019
  4. Junio C HamanoJul 25, 2019
  5. Johannes SchindelinJul 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.