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 <jrnieder@gmail.com> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramkumar Ramachandra committed
Aug 4, 2011 at 16:09 UTC
54decbd4d858f21e2c31601f91675700c7093b1f
1 file changed
+4
-4
builtin/revert.c
+4
-4
@@ -35,7 +35,7 @@ static const char * const cherry_pick_usage[] = {
35
NULL
36
};
37
38
-static int edit, no_replay, no_commit, mainline, signoff, allow_ff;
38
+static int edit, record_origin, no_commit, mainline, signoff, allow_ff;
39
static enum { REVERT, CHERRY_PICK } action;
40
static struct commit *commit;
41
static int commit_argc;
@@ -91,7 +91,7 @@ static void parse_args(int argc, const char **argv)
91
92
if (action == CHERRY_PICK) {
93
struct option cp_extra[] = {
94
- OPT_BOOLEAN('x', NULL, &no_replay, "append commit name"),
94
+ OPT_BOOLEAN('x', NULL, &record_origin, "append commit name"),
95
OPT_BOOLEAN(0, "ff", &allow_ff, "allow fast-forward"),
96
OPT_END(),
97
};
@@ -464,7 +464,7 @@ static int do_pick_commit(void)
464
strbuf_addstr(&msgbuf, p);
465
}
466
467
- if (no_replay) {
467
+ if (record_origin) {
468
strbuf_addstr(&msgbuf, "(cherry picked from commit ");
469
strbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));
470
strbuf_addstr(&msgbuf, ")\n");
@@ -559,7 +559,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
559
die(_("cherry-pick --ff cannot be used with --signoff"));
560
if (no_commit)
561
die(_("cherry-pick --ff cannot be used with --no-commit"));
562
- if (no_replay)
562
+ if (record_origin)
563
die(_("cherry-pick --ff cannot be used with -x"));
564
if (edit)
565
die(_("cherry-pick --ff cannot be used with --edit"));