Skip to content

Commit 060e602

Browse files
pks-tgitster
authored andcommitted
builtin/history: rename "--ref-action=" to "--update-refs="
With the preceding commit we have changed "--ref-action=" to only control which refs are supposed to be updated, not what happens with them. As a consequence, the option is now somewhat misnamed, as we don't control the action itself anymore. Rename it to "--update-refs=" to better align it with its new use. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 1073fa1 commit 060e602

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

Documentation/git-history.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-history - EXPERIMENTAL: Rewrite history
88
SYNOPSIS
99
--------
1010
[synopsis]
11-
git history reword <commit> [--dry-run] [--ref-action=(branches|head)]
11+
git history reword <commit> [--dry-run] [--update-refs=(branches|head)]
1212

1313
DESCRIPTION
1414
-----------
@@ -66,7 +66,7 @@ OPTIONS
6666
objects will be written into the repository, so applying these printed
6767
ref updates is generally safe.
6868

69-
`--ref-action=(branches|head)`::
69+
`--update-refs=(branches|head)`::
7070
Control which references will be updated by the command, if any. With
7171
`branches`, all local branches that point to commits which are
7272
descendants of the original commit will be rewritten. With `head`, only

builtin/history.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "wt-status.h"
1919

2020
#define GIT_HISTORY_REWORD_USAGE \
21-
N_("git history reword <commit> [--dry-run] [--ref-action=(branches|head)]")
21+
N_("git history reword <commit> [--dry-run] [--update-refs=(branches|head)]")
2222

2323
static void change_data_free(void *util, const char *str UNUSED)
2424
{
@@ -258,7 +258,7 @@ static int setup_revwalk(struct repository *repo,
258258
goto out;
259259
} else if (!ret) {
260260
ret = error(_("rewritten commit must be an ancestor "
261-
"of HEAD when using --ref-action=head"));
261+
"of HEAD when using --update-refs=head"));
262262
goto out;
263263
}
264264

@@ -416,8 +416,8 @@ static int cmd_history_reword(int argc,
416416
enum ref_action action = REF_ACTION_DEFAULT;
417417
int dry_run = 0;
418418
struct option options[] = {
419-
OPT_CALLBACK_F(0, "ref-action", &action, N_("<action>"),
420-
N_("control ref update behavior (branches|head)"),
419+
OPT_CALLBACK_F(0, "update-refs", &action, N_("<action>"),
420+
N_("control which refs should be updated (branches|head)"),
421421
PARSE_OPT_NONEG, parse_ref_action),
422422
OPT_BOOL('n', "dry-run", &dry_run,
423423
N_("perform a dry-run without updating any refs")),

t/t3451-history-reword.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ test_expect_success '--dry-run prints ref updates without modifying repo' '
233233
test_commit theirs &&
234234
235235
git refs list >refs-expect &&
236-
reword_with_message --dry-run --ref-action=head base >updates <<-\EOF &&
236+
reword_with_message --dry-run --update-refs=head base >updates <<-\EOF &&
237237
reworded commit
238238
EOF
239239
git refs list >refs-actual &&
@@ -258,7 +258,7 @@ test_expect_success '--dry-run prints ref updates without modifying repo' '
258258
)
259259
'
260260

261-
test_expect_success '--ref-action=head updates only HEAD' '
261+
test_expect_success '--update-refs=head updates only HEAD' '
262262
test_when_finished "rm -rf repo" &&
263263
git init repo --initial-branch=main &&
264264
(
@@ -271,10 +271,10 @@ test_expect_success '--ref-action=head updates only HEAD' '
271271
272272
# When told to update HEAD, only, the command will refuse to
273273
# rewrite commits that are not an ancestor of HEAD.
274-
test_must_fail git -c core.editor=false history reword --ref-action=head theirs 2>err &&
274+
test_must_fail git -c core.editor=false history reword --update-refs=head theirs 2>err &&
275275
test_grep "rewritten commit must be an ancestor of HEAD" err &&
276276
277-
reword_with_message --ref-action=head base >updates <<-\EOF &&
277+
reword_with_message --update-refs=head base >updates <<-\EOF &&
278278
reworded base
279279
EOF
280280
expect_log HEAD <<-\EOF &&

0 commit comments

Comments
 (0)