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 <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Feb 15, 2020 at 21:36 UTC
c2417d3af7574adc1fb14f7df31b862aa9551e2e
3 files changed
+10
-10
builtin/rebase.c
+1
-1
@@ -1441,7 +1441,7 @@ static void set_reflog_action(struct rebase_options *options)
1441
if (env && strcmp("rebase", env))
1442
return; /* only override it if it is "rebase" */
1443
1444
- strbuf_addf(&buf, "rebase -i (%s)", options->action);
1444
+ strbuf_addf(&buf, "rebase (%s)", options->action);
1445
setenv(GIT_REFLOG_ACTION_ENVIRONMENT, buf.buf, 1);
1446
strbuf_release(&buf);
1447
}
sequencer.c
+4
-4
@@ -290,7 +290,7 @@ int sequencer_remove_state(struct replay_opts *opts)
290
char *eol = strchr(p, '\n');
291
if (eol)
292
*eol = '\0';
293
- if (delete_ref("(rebase -i) cleanup", p, NULL, 0) < 0) {
293
+ if (delete_ref("(rebase) cleanup", p, NULL, 0) < 0) {
294
warning(_("could not delete '%s'"), p);
295
ret = -1;
296
}
@@ -324,7 +324,7 @@ static const char *action_name(const struct replay_opts *opts)
324
case REPLAY_PICK:
325
return N_("cherry-pick");
326
case REPLAY_INTERACTIVE_REBASE:
327
- return N_("rebase -i");
327
+ return N_("rebase");
328
}
329
die(_("unknown action: %d"), opts->action);
330
}
@@ -628,7 +628,7 @@ static int do_recursive_merge(struct repository *r,
628
COMMIT_LOCK | SKIP_IF_UNCHANGED))
629
/*
630
* TRANSLATORS: %s will be "revert", "cherry-pick" or
631
- * "rebase -i".
631
+ * "rebase".
632
*/
633
return error(_("%s: Unable to write new index file"),
634
_(action_name(opts)));
@@ -3199,7 +3199,7 @@ static int do_label(struct repository *r, const char *name, int len)
3199
return error(_("illegal label name: '%.*s'"), len, name);
3200
3201
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);
3203
3204
transaction = ref_store_transaction_begin(refs, &err);
3205
if (!transaction) {
t/t3404-rebase-interactive.sh
+5
-5
@@ -223,7 +223,7 @@ test_expect_success 'reflog for the branch shows state before rebase' '
223
'
224
225
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" \
227
"$(git rev-parse branch2)" >expected &&
228
git log -g --pretty=%gs -1 refs/heads/branch1 >actual &&
229
test_cmp expected actual
@@ -1162,10 +1162,10 @@ test_expect_success 'rebase -i produces readable reflog' '
1162
git branch -f branch-reflog-test H &&
1163
git rebase -i --onto I F branch-reflog-test &&
1164
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
1169
EOF
1170
git reflog -n4 HEAD |
1171
sed "s/[^:]*: //" >actual &&