diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-04-22 23:43:00 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-22 23:43:00 +0300 |
commit | d6d561db1c0a14e8b89149694c0c662096c5fc9d (patch) | |
tree | d0180fa78b9b0c5d4c03e843686cdffcac8647e2 /builtin/rebase.c | |
parent | c7d8f69da5443788950b823bd6b9b663e1e686a3 (diff) | |
parent | 0fcb4f6b62c87a73971890070dea847b56176338 (diff) |
Merge branch 'jt/rebase-allow-duplicate'
Allow "git rebase" to reapply all local commits, even if the may be
already in the upstream, without checking first.
* jt/rebase-allow-duplicate:
rebase --merge: optionally skip upstreamed commits
Diffstat (limited to 'builtin/rebase.c')
-rw-r--r-- | builtin/rebase.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c index b62b450f8c..c466923869 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -96,6 +96,7 @@ struct rebase_options { struct strbuf git_format_patch_opt; int reschedule_failed_exec; int use_legacy_rebase; + int reapply_cherry_picks; }; #define REBASE_OPTIONS_INIT { \ @@ -387,6 +388,7 @@ static int run_sequencer_rebase(struct rebase_options *opts, flags |= opts->rebase_cousins > 0 ? TODO_LIST_REBASE_COUSINS : 0; flags |= opts->root_with_onto ? TODO_LIST_ROOT_WITH_ONTO : 0; flags |= command == ACTION_SHORTEN_OIDS ? TODO_LIST_SHORTEN_IDS : 0; + flags |= opts->reapply_cherry_picks ? TODO_LIST_REAPPLY_CHERRY_PICKS : 0; switch (command) { case ACTION_NONE: { @@ -1586,6 +1588,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) OPT_BOOL(0, "reschedule-failed-exec", &reschedule_failed_exec, N_("automatically re-schedule any `exec` that fails")), + OPT_BOOL(0, "reapply-cherry-picks", &options.reapply_cherry_picks, + N_("apply all changes, even those already present upstream")), OPT_END(), }; int i; @@ -1829,6 +1833,9 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) if (options.empty != EMPTY_UNSPECIFIED) imply_merge(&options, "--empty"); + if (options.reapply_cherry_picks) + imply_merge(&options, "--reapply-cherry-picks"); + if (gpg_sign) options.gpg_sign_opt = xstrfmt("-S%s", gpg_sign); |