diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-04-30 14:58:00 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-04-30 14:58:01 -0700 |
commit | 1692579dd3569ebc01187872db91ee2ad93cc962 (patch) | |
tree | a0f3f06c4a4d4fd9ee038de63ce69d165fc7ac22 /builtin/revert.c | |
parent | Merge branch 'jk/maint-config-bogus-section' (diff) | |
parent | git-rebase: add keep_empty flag (diff) | |
download | tgif-1692579dd3569ebc01187872db91ee2ad93cc962.tar.xz |
Merge branch 'nh/empty-rebase'
"git rebase" learned to optionally keep commits that do not introduce
any change in the original history.
By Neil Horman
* nh/empty-rebase:
git-rebase: add keep_empty flag
git-cherry-pick: Add test to validate new options
git-cherry-pick: Add keep-redundant-commits option
git-cherry-pick: add allow-empty option
Diffstat (limited to 'builtin/revert.c')
-rw-r--r-- | builtin/revert.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/revert.c b/builtin/revert.c index 5462e676e2..82d1bf844b 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -115,12 +115,16 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts) OPT_END(), OPT_END(), OPT_END(), + OPT_END(), + OPT_END(), }; if (opts->action == REPLAY_PICK) { struct option cp_extra[] = { OPT_BOOLEAN('x', NULL, &opts->record_origin, "append commit name"), OPT_BOOLEAN(0, "ff", &opts->allow_ff, "allow fast-forward"), + OPT_BOOLEAN(0, "allow-empty", &opts->allow_empty, "preserve initially empty commits"), + OPT_BOOLEAN(0, "keep-redundant-commits", &opts->keep_redundant_commits, "keep redundant, empty commits"), OPT_END(), }; if (parse_options_concat(options, ARRAY_SIZE(options), cp_extra)) @@ -138,6 +142,10 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts) "--abort", rollback, NULL); + /* implies allow_empty */ + if (opts->keep_redundant_commits) + opts->allow_empty = 1; + /* Set the subcommand */ if (remove_state) opts->subcommand = REPLAY_REMOVE_STATE; |