Skip to content

Commit c2417d3

Browse files
newrengitster
authored andcommitted
rebase: drop '-i' from the reflog for interactive-based rebases
A large variety of rebase types are supported by the interactive machinery, not just the explicitly interactive ones. These all share the same code and write the same reflog messages, but the "-i" moniker in those messages doesn't really have much meaning. It also becomes somewhat distracting once we switch the default from the am-backend to the interactive one. Just remove the "-i" from these messages. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6d04ce7 commit c2417d3

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

builtin/rebase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ static void set_reflog_action(struct rebase_options *options)
14411441
if (env && strcmp("rebase", env))
14421442
return; /* only override it if it is "rebase" */
14431443

1444-
strbuf_addf(&buf, "rebase -i (%s)", options->action);
1444+
strbuf_addf(&buf, "rebase (%s)", options->action);
14451445
setenv(GIT_REFLOG_ACTION_ENVIRONMENT, buf.buf, 1);
14461446
strbuf_release(&buf);
14471447
}

sequencer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ int sequencer_remove_state(struct replay_opts *opts)
290290
char *eol = strchr(p, '\n');
291291
if (eol)
292292
*eol = '\0';
293-
if (delete_ref("(rebase -i) cleanup", p, NULL, 0) < 0) {
293+
if (delete_ref("(rebase) cleanup", p, NULL, 0) < 0) {
294294
warning(_("could not delete '%s'"), p);
295295
ret = -1;
296296
}
@@ -324,7 +324,7 @@ static const char *action_name(const struct replay_opts *opts)
324324
case REPLAY_PICK:
325325
return N_("cherry-pick");
326326
case REPLAY_INTERACTIVE_REBASE:
327-
return N_("rebase -i");
327+
return N_("rebase");
328328
}
329329
die(_("unknown action: %d"), opts->action);
330330
}
@@ -628,7 +628,7 @@ static int do_recursive_merge(struct repository *r,
628628
COMMIT_LOCK | SKIP_IF_UNCHANGED))
629629
/*
630630
* TRANSLATORS: %s will be "revert", "cherry-pick" or
631-
* "rebase -i".
631+
* "rebase".
632632
*/
633633
return error(_("%s: Unable to write new index file"),
634634
_(action_name(opts)));
@@ -3199,7 +3199,7 @@ static int do_label(struct repository *r, const char *name, int len)
31993199
return error(_("illegal label name: '%.*s'"), len, name);
32003200

32013201
strbuf_addf(&ref_name, "refs/rewritten/%.*s", len, name);
3202-
strbuf_addf(&msg, "rebase -i (label) '%.*s'", len, name);
3202+
strbuf_addf(&msg, "rebase (label) '%.*s'", len, name);
32033203

32043204
transaction = ref_store_transaction_begin(refs, &err);
32053205
if (!transaction) {

t/t3404-rebase-interactive.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ test_expect_success 'reflog for the branch shows state before rebase' '
223223
'
224224

225225
test_expect_success 'reflog for the branch shows correct finish message' '
226-
printf "rebase -i (finish): refs/heads/branch1 onto %s\n" \
226+
printf "rebase (finish): refs/heads/branch1 onto %s\n" \
227227
"$(git rev-parse branch2)" >expected &&
228228
git log -g --pretty=%gs -1 refs/heads/branch1 >actual &&
229229
test_cmp expected actual
@@ -1162,10 +1162,10 @@ test_expect_success 'rebase -i produces readable reflog' '
11621162
git branch -f branch-reflog-test H &&
11631163
git rebase -i --onto I F branch-reflog-test &&
11641164
cat >expect <<-\EOF &&
1165-
rebase -i (finish): returning to refs/heads/branch-reflog-test
1166-
rebase -i (pick): H
1167-
rebase -i (pick): G
1168-
rebase -i (start): checkout I
1165+
rebase (finish): returning to refs/heads/branch-reflog-test
1166+
rebase (pick): H
1167+
rebase (pick): G
1168+
rebase (start): checkout I
11691169
EOF
11701170
git reflog -n4 HEAD |
11711171
sed "s/[^:]*: //" >actual &&

0 commit comments

Comments
 (0)