Skip to content

Commit 54decbd

Browse files
artagnongitster
authored andcommitted
revert: Rename no_replay to record_origin
The "-x" command-line option is used to record the name of the original commits being picked in the commit message. The variable corresponding to this option is named "no_replay" for historical reasons; the name is especially confusing because the term "replay" is used to describe what cherry-pick does (for example, in the documentation of the "--mainline" option). So, give the variable corresponding to the "-x" command-line option a better name: "record_origin". Mentored-by: Jonathan Nieder <[email protected]> Signed-off-by: Ramkumar Ramachandra <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a2ec3ad commit 54decbd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/revert.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static const char * const cherry_pick_usage[] = {
3535
NULL
3636
};
3737

38-
static int edit, no_replay, no_commit, mainline, signoff, allow_ff;
38+
static int edit, record_origin, no_commit, mainline, signoff, allow_ff;
3939
static enum { REVERT, CHERRY_PICK } action;
4040
static struct commit *commit;
4141
static int commit_argc;
@@ -91,7 +91,7 @@ static void parse_args(int argc, const char **argv)
9191

9292
if (action == CHERRY_PICK) {
9393
struct option cp_extra[] = {
94-
OPT_BOOLEAN('x', NULL, &no_replay, "append commit name"),
94+
OPT_BOOLEAN('x', NULL, &record_origin, "append commit name"),
9595
OPT_BOOLEAN(0, "ff", &allow_ff, "allow fast-forward"),
9696
OPT_END(),
9797
};
@@ -464,7 +464,7 @@ static int do_pick_commit(void)
464464
strbuf_addstr(&msgbuf, p);
465465
}
466466

467-
if (no_replay) {
467+
if (record_origin) {
468468
strbuf_addstr(&msgbuf, "(cherry picked from commit ");
469469
strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));
470470
strbuf_addstr(&msgbuf, ")\n");
@@ -559,7 +559,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
559559
die(_("cherry-pick --ff cannot be used with --signoff"));
560560
if (no_commit)
561561
die(_("cherry-pick --ff cannot be used with --no-commit"));
562-
if (no_replay)
562+
if (record_origin)
563563
die(_("cherry-pick --ff cannot be used with -x"));
564564
if (edit)
565565
die(_("cherry-pick --ff cannot be used with --edit"));

0 commit comments

Comments
 (0)