Skip to contentSkip to conversation

wt-status: give better advice when cherry-pick is in progress

PATCH In review Ralf Thielow 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wt-status: give better advice when cherry-pick is in progress

When cherry-pick is in progress, 'git status' gives the advice to run "git commit" to finish the cherry-pick. However, this won't continue the sequencer.
"git status" should give the advice of running "git cherry-pick --continue" or "git cherry-pick --abort".

---
 t/t7512-status-help.sh | 6 ++++--
 wt-status.c            | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
t/t7512-status-help.sh +4 -2
index bf08d4e..4f09bec 100755
@@ -632,7 +632,8 @@ test_expect_success 'status when cherry-picking before resolving conflicts' '
 	cat >expected <<-\EOF &&
 	# On branch cherry_branch
 	# You are currently cherry-picking.
-	#   (fix conflicts and run "git commit")
+	#   (fix conflicts and run "git cherry-pick --continue")
+	#   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 	#
 	# Unmerged paths:
 	#   (use "git add <file>..." to mark resolution)
@@ -655,7 +656,8 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
 	cat >expected <<-\EOF &&
 	# On branch cherry_branch
 	# You are currently cherry-picking.
-	#   (all conflicts fixed: run "git commit")
+	#   (all conflicts fixed: run "git cherry-pick --continue")
+	#   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 	#
 	# Changes to be committed:
 	#
wt-status.c +4 -2
index bf84a86..438a40d 100644
@@ -955,10 +955,12 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
 	if (advice_status_hints) {
 		if (has_unmerged(s))
 			status_printf_ln(s, color,
-				_("  (fix conflicts and run \"git commit\")"));
+				_("  (fix conflicts and run \"git cherry-pick --continue\")"));
 		else
 			status_printf_ln(s, color,
-				_("  (all conflicts fixed: run \"git commit\")"));
+				_("  (all conflicts fixed: run \"git cherry-pick --continue\")"));
+		status_printf_ln(s, color,
+			_("  (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"));
 	}
 	wt_status_print_trailer(s);
 }
Signature · 1 line
1.8.3.1.3.gf2b4626.dirty
#1 lore raw
Quoted 5 lines · Ralf Thielow

When cherry-pick is in progress, 'git status' gives the advice to run "git commit" to finish the cherry-pick. However, this won't continue the sequencer.
"git status" should give the advice of running "git cherry-pick --continue" or "git cherry-pick --abort".

Is the above _always_ the case, or does the updated advice message only apply when you are cherry-picking a range of commits with "git cherry-pick A..B"? In other words, when "git cherry-pick $it" (a single commit) stops, waiting for your help to resolve it, would "git cherry-pick --continue" conclude it?

If that works then this definitely is a good change (the user only needs to know "cherry-pick --continue").

Quoted 49 lines
---
 t/t7512-status-help.sh | 6 ++++--
 wt-status.c            | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
t/t7512-status-help.sh +4 -2
index bf08d4e..4f09bec 100755
@@ -632,7 +632,8 @@ test_expect_success 'status when cherry-picking before resolving conflicts' '
 	cat >expected <<-\EOF &&
 	# On branch cherry_branch
 	# You are currently cherry-picking.
-	#   (fix conflicts and run "git commit")
+	#   (fix conflicts and run "git cherry-pick --continue")
+	#   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 	#
 	# Unmerged paths:
 	#   (use "git add <file>..." to mark resolution)
@@ -655,7 +656,8 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
 	cat >expected <<-\EOF &&
 	# On branch cherry_branch
 	# You are currently cherry-picking.
-	#   (all conflicts fixed: run "git commit")
+	#   (all conflicts fixed: run "git cherry-pick --continue")
+	#   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
 	#
 	# Changes to be committed:
 	#
wt-status.c +4 -2
index bf84a86..438a40d 100644
@@ -955,10 +955,12 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
 	if (advice_status_hints) {
 		if (has_unmerged(s))
 			status_printf_ln(s, color,
-				_("  (fix conflicts and run \"git commit\")"));
+				_("  (fix conflicts and run \"git cherry-pick --continue\")"));
 		else
 			status_printf_ln(s, color,
-				_("  (all conflicts fixed: run \"git commit\")"));
+				_("  (all conflicts fixed: run \"git cherry-pick --continue\")"));
+		status_printf_ln(s, color,
+			_("  (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"));
 	}
 	wt_status_print_trailer(s);
 }
#2 lore raw

2013/6/17 Junio C Hamano <[email protected]>:

Quoted 8 lines
Quoted 5 lines · Ralf Thielow

When cherry-pick is in progress, 'git status' gives the advice to run "git commit" to finish the cherry-pick. However, this won't continue the sequencer.
"git status" should give the advice of running "git cherry-pick --continue" or "git cherry-pick --abort".

Quoted 6 lines

Is the above _always_ the case, or does the updated advice message only apply when you are cherry-picking a range of commits with "git cherry-pick A..B"? In other words, when "git cherry-pick $it" (a single commit) stops, waiting for your help to resolve it, would "git cherry-pick --continue" conclude it?

Yes, both "--continue" and "--abort" works with a single commit.

Quoted 52 lines

If that works then this definitely is a good change (the user only needs to know "cherry-pick --continue").

Quoted 49 lines
---
 t/t7512-status-help.sh | 6 ++++--
 wt-status.c            | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
t/t7512-status-help.sh +4 -2
index bf08d4e..4f09bec 100755
@@ -632,7 +632,8 @@ test_expect_success 'status when cherry-picking before resolving conflicts' '
      cat >expected <<-\EOF &&
      # On branch cherry_branch
      # You are currently cherry-picking.
-     #   (fix conflicts and run "git commit")
+     #   (fix conflicts and run "git cherry-pick --continue")
+     #   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
      #
      # Unmerged paths:
      #   (use "git add <file>..." to mark resolution)
@@ -655,7 +656,8 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
      cat >expected <<-\EOF &&
      # On branch cherry_branch
      # You are currently cherry-picking.
-     #   (all conflicts fixed: run "git commit")
+     #   (all conflicts fixed: run "git cherry-pick --continue")
+     #   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
      #
      # Changes to be committed:
      #
wt-status.c +4 -2
index bf84a86..438a40d 100644
@@ -955,10 +955,12 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
      if (advice_status_hints) {
              if (has_unmerged(s))
                      status_printf_ln(s, color,
-                             _("  (fix conflicts and run \"git commit\")"));
+                             _("  (fix conflicts and run \"git cherry-pick --continue\")"));
              else
                      status_printf_ln(s, color,
-                             _("  (all conflicts fixed: run \"git commit\")"));
+                             _("  (all conflicts fixed: run \"git cherry-pick --continue\")"));
+             status_printf_ln(s, color,
+                     _("  (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"));
      }
      wt_status_print_trailer(s);
 }
#3 lore raw
Quoted 9 lines · Ralf Thielow

2013/6/17 Junio C Hamano <[email protected]>:

Quoted 8 lines
Quoted 5 lines · Ralf Thielow

When cherry-pick is in progress, 'git status' gives the advice to run "git commit" to finish the cherry-pick. However, this won't continue the sequencer.
"git status" should give the advice of running "git cherry-pick --continue" or "git cherry-pick --abort".

Quoted 8 lines
Quoted 6 lines

Is the above _always_ the case, or does the updated advice message only apply when you are cherry-picking a range of commits with "git cherry-pick A..B"? In other words, when "git cherry-pick $it" (a single commit) stops, waiting for your help to resolve it, would "git cherry-pick --continue" conclude it?

Yes, both "--continue" and "--abort" works with a single commit.

Perhaps that is a good thing to explain, in addition to "won't continue the sequencer", as single-pick case does not have much to do with it ;-)

Thanks, will queue.

Quoted 52 lines
Quoted 52 lines

If that works then this definitely is a good change (the user only needs to know "cherry-pick --continue").

Quoted 49 lines
---
 t/t7512-status-help.sh | 6 ++++--
 wt-status.c            | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
t/t7512-status-help.sh +4 -2
index bf08d4e..4f09bec 100755
@@ -632,7 +632,8 @@ test_expect_success 'status when cherry-picking before resolving conflicts' '
      cat >expected <<-\EOF &&
      # On branch cherry_branch
      # You are currently cherry-picking.
-     #   (fix conflicts and run "git commit")
+     #   (fix conflicts and run "git cherry-pick --continue")
+     #   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
      #
      # Unmerged paths:
      #   (use "git add <file>..." to mark resolution)
@@ -655,7 +656,8 @@ test_expect_success 'status when cherry-picking after resolving conflicts' '
      cat >expected <<-\EOF &&
      # On branch cherry_branch
      # You are currently cherry-picking.
-     #   (all conflicts fixed: run "git commit")
+     #   (all conflicts fixed: run "git cherry-pick --continue")
+     #   (use "git cherry-pick --abort" to cancel the cherry-pick operation)
      #
      # Changes to be committed:
      #
wt-status.c +4 -2
index bf84a86..438a40d 100644
@@ -955,10 +955,12 @@ static void show_cherry_pick_in_progress(struct wt_status *s,
      if (advice_status_hints) {
              if (has_unmerged(s))
                      status_printf_ln(s, color,
-                             _("  (fix conflicts and run \"git commit\")"));
+                             _("  (fix conflicts and run \"git cherry-pick --continue\")"));
              else
                      status_printf_ln(s, color,
-                             _("  (all conflicts fixed: run \"git commit\")"));
+                             _("  (all conflicts fixed: run \"git cherry-pick --continue\")"));
+             status_printf_ln(s, color,
+                     _("  (use \"git cherry-pick --abort\" to cancel the cherry-pick operation)"));
      }
      wt_status_print_trailer(s);
 }