aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-04-08 10:19:18 -0700
committerJunio C Hamano <gitster@pobox.com>2026-04-08 10:19:18 -0700
commit37a4780f2c30de9fe0bef533a266c6bca767a50f (patch)
tree601afbae0030003f3089e95b22dc466d64874d32 /builtin
parentd8c553bbed21761a8af3fa40a20518e210e78a0d (diff)
parent23d83f8ddbef9adcb87671358b473e55cf90c90b (diff)
downloadgit-37a4780f2c30de9fe0bef533a266c6bca767a50f.tar.xz
Merge branch 'tc/replay-ref'
The experimental `git replay` command learned the `--ref=<ref>` option to allow specifying which ref to update, overriding the default behavior. * tc/replay-ref: replay: allow to specify a ref with option --ref replay: use stuck form in documentation and help message builtin/replay: mark options as not negatable
Diffstat (limited to 'builtin')
-rw-r--r--builtin/replay.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/builtin/replay.c b/builtin/replay.c
index a0879b020f..39e3a86f6c 100644
--- a/builtin/replay.c
+++ b/builtin/replay.c
@@ -84,25 +84,33 @@ int cmd_replay(int argc,
const char *const replay_usage[] = {
N_("(EXPERIMENTAL!) git replay "
- "([--contained] --onto <newbase> | --advance <branch> | --revert <branch>) "
- "[--ref-action[=<mode>]] <revision-range>"),
+ "([--contained] --onto=<newbase> | --advance=<branch> | --revert=<branch>)\n"
+ "[--ref=<ref>] [--ref-action=<mode>] <revision-range>"),
NULL
};
struct option replay_options[] = {
- OPT_STRING(0, "advance", &opts.advance,
- N_("branch"),
- N_("make replay advance given branch")),
- OPT_STRING(0, "onto", &opts.onto,
- N_("revision"),
- N_("replay onto given commit")),
OPT_BOOL(0, "contained", &opts.contained,
N_("update all branches that point at commits in <revision-range>")),
- OPT_STRING(0, "revert", &opts.revert,
- N_("branch"),
- N_("revert commits onto given branch")),
- OPT_STRING(0, "ref-action", &ref_action,
- N_("mode"),
- N_("control ref update behavior (update|print)")),
+ OPT_STRING_F(0, "onto", &opts.onto,
+ N_("revision"),
+ N_("replay onto given commit"),
+ PARSE_OPT_NONEG),
+ OPT_STRING_F(0, "advance", &opts.advance,
+ N_("branch"),
+ N_("make replay advance given branch"),
+ PARSE_OPT_NONEG),
+ OPT_STRING_F(0, "revert", &opts.revert,
+ N_("branch"),
+ N_("revert commits onto given branch"),
+ PARSE_OPT_NONEG),
+ OPT_STRING_F(0, "ref", &opts.ref,
+ N_("branch"),
+ N_("reference to update with result"),
+ PARSE_OPT_NONEG),
+ OPT_STRING_F(0, "ref-action", &ref_action,
+ N_("mode"),
+ N_("control ref update behavior (update|print)"),
+ PARSE_OPT_NONEG),
OPT_END()
};
@@ -122,6 +130,8 @@ int cmd_replay(int argc,
opts.contained, "--contained");
die_for_incompatible_opt2(!!opts.revert, "--revert",
opts.contained, "--contained");
+ die_for_incompatible_opt2(!!opts.ref, "--ref",
+ !!opts.contained, "--contained");
/* Parse ref action mode from command line or config */
ref_mode = get_ref_action_mode(repo, ref_action);