From b0a61ab23c0fd51a1b641b481e6a63f8661a8f9f Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Thu, 21 Jul 2016 14:58:37 +0200 Subject: [PATCH] status: suggest 'git merge --abort' when appropriate We already suggest 'git rebase --abort' during a conflicted rebase. Similarly, suggest 'git merge --abort' during conflict resolution on 'git merge'. Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- t/t7060-wtstatus.sh | 4 ++++ t/t7512-status-help.sh | 1 + wt-status.c | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index 44bf1d84af..4d17363a92 100755 --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@ -34,6 +34,7 @@ test_expect_success 'M/D conflict does not segfault' ' On branch side You have unmerged paths. (fix conflicts and run "git commit") + (use "git merge --abort" to abort the merge) Unmerged paths: (use "git add/rm ..." as appropriate to mark resolution) @@ -138,6 +139,7 @@ test_expect_success 'status when conflicts with add and rm advice (deleted by th On branch master You have unmerged paths. (fix conflicts and run "git commit") + (use "git merge --abort" to abort the merge) Unmerged paths: (use "git add/rm ..." as appropriate to mark resolution) @@ -171,6 +173,7 @@ test_expect_success 'status when conflicts with add and rm advice (both deleted) On branch conflict_second You have unmerged paths. (fix conflicts and run "git commit") + (use "git merge --abort" to abort the merge) Unmerged paths: (use "git add/rm ..." as appropriate to mark resolution) @@ -195,6 +198,7 @@ test_expect_success 'status when conflicts with only rm advice (both deleted)' ' On branch conflict_second You have unmerged paths. (fix conflicts and run "git commit") + (use "git merge --abort" to abort the merge) Changes to be committed: diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh index 49d19a3b36..5c3db656df 100755 --- a/t/t7512-status-help.sh +++ b/t/t7512-status-help.sh @@ -29,6 +29,7 @@ test_expect_success 'status when conflicts unresolved' ' On branch conflicts You have unmerged paths. (fix conflicts and run "git commit") + (use "git merge --abort" to abort the merge) Unmerged paths: (use "git add ..." to mark resolution) diff --git a/wt-status.c b/wt-status.c index ced53dd1d4..f6f112b48c 100644 --- a/wt-status.c +++ b/wt-status.c @@ -946,9 +946,12 @@ static void show_merge_in_progress(struct wt_status *s, { if (has_unmerged(s)) { status_printf_ln(s, color, _("You have unmerged paths.")); - if (s->hints) + if (s->hints) { status_printf_ln(s, color, - _(" (fix conflicts and run \"git commit\")")); + _(" (fix conflicts and run \"git commit\")")); + status_printf_ln(s, color, + _(" (use \"git merge --abort\" to abort the merge)")); + } } else { status_printf_ln(s, color, _("All conflicts fixed but you are still merging.")); -- 2.11.4.GIT