[GSoC][PATCH v6 0/5] Teach cherry-pick/revert to skip commits
- From
Rohit Ashiwal <rohit.ashiwal265@gmail.com>
- Date
- Jun 21, 2019, 09:17 UTC
- Message-ID
- <20190621091800.17686-1-rohit.ashiwal265@gmail.com>
- In-Reply-To
- <20190608191958.4593-1-rohit.ashiwal265@gmail.com>
I've covered the advice message behind `advice_resolve_conflict` variable and changed the order of error and advice to match that of 1/5. I believe that we don't have any advice variable appropriate for advice in 1/5.
Rohit Ashiwal (5): sequencer: add advice for revert sequencer: rename reset_for_rollback to reset_merge sequencer: use argv_array in reset_merge cherry-pick/revert: add --skip option cherry-pick/revert: advise using --skip
Documentation/git-cherry-pick.txt | 4 +- Documentation/git-revert.txt | 4 +- Documentation/sequencer.txt | 4 + builtin/commit.c | 13 +-- builtin/revert.c | 5 ++ sequencer.c | 135 ++++++++++++++++++++++++++---- sequencer.h | 1 + t/t3510-cherry-pick-sequence.sh | 122 +++++++++++++++++++++++++++ 8 files changed, 262 insertions(+), 26 deletions(-)
Range-diff:
1: 825486c22d ! 1: 2b16d7ea4d cherry-pick/revert: add --skip option
@@ -168,10 +168,14 @@
+ return sequencer_continue(r, opts);
+
+give_advice:
-+ advise(_("have you committed already?\n"
-+ "try \"git %s --continue\""),
-+ action == REPLAY_REVERT ? "revert" : "cherry-pick");
-+ return error(_("there is nothing to skip"));
++ error(_("there is nothing to skip"));
++
++ if (advice_resolve_conflict) {
++ advise(_("have you committed already?\n"
++ "try \"git %s --continue\""),
++ action == REPLAY_REVERT ? "revert" : "cherry-pick");
++ }
++ return -1;
+}
+
static int save_todo(struct todo_list *todo_list, struct replay_opts *opts)
@@ -263,9 +267,9 @@
+test_expect_success 'check advice when we move HEAD by committing' '
+ pristine_detach initial &&
+ cat >expect <<-EOF &&
++ error: there is nothing to skip
+ hint: have you committed already?
+ hint: try "git cherry-pick --continue"
-+ error: there is nothing to skip
+ fatal: cherry-pick failed
+ EOF
+ test_must_fail git cherry-pick base..yetanotherpick &&
2: 63dbc11ab1 = 2: 8f278b5139 cherry-pick/revert: advise using --skip-- 2.21.0