aboutsummaryrefslogtreecommitdiff
path: root/builtin/revert.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-04-30 14:58:00 -0700
committerJunio C Hamano <gitster@pobox.com>2012-04-30 14:58:01 -0700
commit1692579dd3569ebc01187872db91ee2ad93cc962 (patch)
treea0f3f06c4a4d4fd9ee038de63ce69d165fc7ac22 /builtin/revert.c
parent563b3527b41a978eeef77d9426be460013c35d88 (diff)
parent90e1818f9a06015159712e204dd90868e0a6c421 (diff)
downloadgit-1692579dd3569ebc01187872db91ee2ad93cc962.tar.gz
git-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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/revert.c b/builtin/revert.c
index 5462e676e..82d1bf844 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;