From df478b744cee9821eb2abbe2202d262b87a34289 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Wed, 11 Apr 2012 16:21:53 -0400 Subject: git-cherry-pick: add allow-empty option git cherry-pick fails when picking a non-ff commit that is empty. The advice given with the failure is that a git-commit --allow-empty should be issued to explicitly add the empty commit during the cherry pick. This option allows a user to specify before hand that they want to keep the empty commit. This eliminates the need to issue both a cherry pick and a commit operation. Signed-off-by: Neil Horman Signed-off-by: Junio C Hamano --- builtin/revert.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin') diff --git a/builtin/revert.c b/builtin/revert.c index e6840f23dc..06b00e6f83 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -114,12 +114,14 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts) 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 empty commits"), OPT_END(), }; if (parse_options_concat(options, ARRAY_SIZE(options), cp_extra)) -- cgit v1.2.1