summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorLibravatar Rohit Ashiwal <rohit.ashiwal265@gmail.com>2019-07-02 14:41:29 +0530
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-07-02 12:08:08 -0700
commitdcb500dc16ce8db556b51e9a5b3fa977111d0443 (patch)
tree669235a713ae5f8678f3646539b5593314501695 /sequencer.c
parentcherry-pick/revert: add --skip option (diff)
downloadtgif-dcb500dc16ce8db556b51e9a5b3fa977111d0443.tar.xz
cherry-pick/revert: advise using --skip
The previous commit introduced a --skip flag for cherry-pick and revert. Update the advice messages, to tell users about this less cumbersome way of skipping commits. Also add tests to ensure everything is working fine. Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index dede47a21b..7d0e5f9366 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2655,18 +2655,20 @@ static int create_seq_dir(struct repository *r)
enum replay_action action;
const char *in_progress_error = NULL;
const char *in_progress_advice = NULL;
+ unsigned int advise_skip = file_exists(git_path_revert_head(r)) ||
+ file_exists(git_path_cherry_pick_head(r));
if (!sequencer_get_last_command(r, &action)) {
switch (action) {
case REPLAY_REVERT:
in_progress_error = _("revert is already in progress");
in_progress_advice =
- _("try \"git revert (--continue | --abort | --quit)\"");
+ _("try \"git revert (--continue | %s--abort | --quit)\"");
break;
case REPLAY_PICK:
in_progress_error = _("cherry-pick is already in progress");
in_progress_advice =
- _("try \"git cherry-pick (--continue | --abort | --quit)\"");
+ _("try \"git cherry-pick (--continue | %s--abort | --quit)\"");
break;
default:
BUG("unexpected action in create_seq_dir");
@@ -2675,7 +2677,8 @@ static int create_seq_dir(struct repository *r)
if (in_progress_error) {
error("%s", in_progress_error);
if (advice_sequencer_in_use)
- advise("%s", in_progress_advice);
+ advise(in_progress_advice,
+ advise_skip ? "--skip | " : "");
return -1;
}
if (mkdir(git_path_seq_dir(), 0777) < 0)