Skip to contentSkip to conversation

Clean up more of the fall-out from dropping the scripted git rebase

PATCH In review Johannes Schindelin via GitGitGadget 3 participants 5 messages Jul 24, 2019 – Jul 25, 2019

lore
Share & tools
lore
#0 lore raw

cover Clean up more of the fall-out from dropping the scripted git rebase

I had prepared these patches even before v2.22.0, but deemed them not critical enough to push into that release.

Johannes Schindelin (2):
rebase: fix white-space
git: mark cmd_rebase as requiring a worktree

 builtin/rebase.c | 6 +-----
 git.c            | 7 +------
 2 files changed, 2 insertions(+), 11 deletions(-)

base-commit: 082ef75b7bfc90ac236afbb857a9552a026832b8
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-293%2Fdscho%2Frebase-cleanup-more-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-293/dscho/rebase-cleanup-more-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/293

Signature · 1 line
gitgitgadget
#1 lore raw

PATCH 1/2 rebase: fix white-space

From: Johannes Schindelin <[email protected]>

This trailing space was inadvertently introduced in 9fbcc3d203 (Merge branch 'js/rebase-orig-head-fix', 2019-03-20).

---
 builtin/rebase.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
builtin/rebase.c +1 -1
index 9c52144fc4..798b9ae2d7 100644
@@ -2104,7 +2104,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
 	strbuf_addf(&msg, "%s: checkout %s",
 		    getenv(GIT_REFLOG_ACTION_ENVIRONMENT), options.onto_name);
 	if (reset_head(&options.onto->object.oid, "checkout", NULL,
-		       RESET_HEAD_DETACH | RESET_ORIG_HEAD | 
+		       RESET_HEAD_DETACH | RESET_ORIG_HEAD |
 		       RESET_HEAD_RUN_POST_CHECKOUT_HOOK,
 		       NULL, msg.buf))
 		die(_("Could not detach HEAD"));
Signature · 1 line
gitgitgadget
#2 lore raw

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

In reply to Johannes Schindelin via GitGitGadget

From: Johannes Schindelin <[email protected]>

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.

---
 builtin/rebase.c | 4 ----
 git.c            | 7 +------
 2 files changed, 1 insertion(+), 10 deletions(-)
builtin/rebase.c +0 -4
index 798b9ae2d7..b33ec9c7c0 100644
@@ -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);
 
git.c +1 -6
index 1bf9c94550..1461e819c3 100644
@@ -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 },
Signature · 1 line
gitgitgadget
#4 lore raw

Hi Junio,

Quoted 8 lines · Junio C Hamano

"Johannes Schindelin via GitGitGadget" <[email protected]>

Quoted 2 lines · writes:

I had prepared these patches even before v2.22.0, but deemed them not critical enough to push into that release.

Thanks. Both of these look quite sensible. Will queue and fast-track.

Thank you!
Dscho