public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH 1/4] status: factor two rebase-related messages together
@ 2015-06-09 14:42 Guillaume Pagès
  2015-06-09 14:42 ` [PATCH 2/4] status: differentiate interactive from non-interactive rebases Guillaume Pagès
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Guillaume Pagès @ 2015-06-09 14:42 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, Remi Galan, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite, Matthieu Moy

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag•grenoble-inp.fr>
---
 wt-status.c | 31 +++++++++++++++----------------
 1 file changed, 15 insertions(+), 16 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 33452f1..c239132 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1025,6 +1025,19 @@ static int split_commit_in_progress(struct wt_status *s)
 	free(rebase_orig_head);
 	return split_in_progress;
 }
+static void print_rebase_state(struct wt_status *s,
+				struct wt_status_state *state,
+				const char *color)
+{
+		if (state->branch)
+			status_printf_ln(s, color,
+					 _("You are currently rebasing branch '%s' on '%s'."),
+					 state->branch,
+					 state->onto);
+		else
+			status_printf_ln(s, color,
+					 _("You are currently rebasing."));
+}
 
 static void show_rebase_in_progress(struct wt_status *s,
 				struct wt_status_state *state,
@@ -1033,14 +1046,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 	struct stat st;
 
 	if (has_unmerged(s)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints) {
 			status_printf_ln(s, color,
 				_("  (fix conflicts and then run \"git rebase --continue\")"));
@@ -1050,14 +1056,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 				_("  (use \"git rebase --abort\" to check out the original branch)"));
 		}
 	} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
+		print_rebase_state(s, state, color);
 		if (s->hints)
 			status_printf_ln(s, color,
 				_("  (all conflicts fixed: run \"git rebase --continue\")"));
-- 
2.4.2.342.ga3499d3

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH 1/4] status: factor two rebase-related messages together
@ 2015-06-03 22:00 Guillaume Pagès
  2015-06-03 22:00 ` [PATCH 2/4] status: differentiate interactive from non-interactive rebases Guillaume Pagès
  0 siblings, 1 reply; 8+ messages in thread
From: Guillaume Pagès @ 2015-06-03 22:00 UTC (permalink / raw)
  To: git
  Cc: Remi Galan, Remi Lespinet, Guillaume Pages,
	Louis-Alexandre Stuber, Antoine Delaite, Matthieu Moy

---
 wt-status.c | 30 +++++++++++-------------------
 1 file changed, 11 insertions(+), 19 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index 33452f1..fec6e85 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1032,7 +1032,7 @@ static void show_rebase_in_progress(struct wt_status *s,
 {
 	struct stat st;
 
-	if (has_unmerged(s)) {
+	if (has_unmerged(s) || state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
 		if (state->branch)
 			status_printf_ln(s, color,
 					 _("You are currently rebasing branch '%s' on '%s'."),
@@ -1042,25 +1042,17 @@ static void show_rebase_in_progress(struct wt_status *s,
 			status_printf_ln(s, color,
 					 _("You are currently rebasing."));
 		if (s->hints) {
-			status_printf_ln(s, color,
-				_("  (fix conflicts and then run \"git rebase --continue\")"));
-			status_printf_ln(s, color,
-				_("  (use \"git rebase --skip\" to skip this patch)"));
-			status_printf_ln(s, color,
-				_("  (use \"git rebase --abort\" to check out the original branch)"));
+			if (has_unmerged(s)) {
+				status_printf_ln(s, color,
+					_("  (fix conflicts and then run \"git rebase --continue\")"));
+				status_printf_ln(s, color,
+					_("  (use \"git rebase --skip\" to skip this patch)"));
+				status_printf_ln(s, color,
+					_("  (use \"git rebase --abort\" to check out the original branch)"));
+			} else
+				status_printf_ln(s, color,
+					_("  (all conflicts fixed: run \"git rebase --continue\")"));
 		}
-	} else if (state->rebase_in_progress || !stat(git_path("MERGE_MSG"), &st)) {
-		if (state->branch)
-			status_printf_ln(s, color,
-					 _("You are currently rebasing branch '%s' on '%s'."),
-					 state->branch,
-					 state->onto);
-		else
-			status_printf_ln(s, color,
-					 _("You are currently rebasing."));
-		if (s->hints)
-			status_printf_ln(s, color,
-				_("  (all conflicts fixed: run \"git rebase --continue\")"));
 	} else if (split_commit_in_progress(s)) {
 		if (state->branch)
 			status_printf_ln(s, color,
-- 
2.4.2.342.g3cebd9b

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-06-09 18:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-09 14:42 [PATCH 1/4] status: factor two rebase-related messages together Guillaume Pagès
2015-06-09 14:42 ` [PATCH 2/4] status: differentiate interactive from non-interactive rebases Guillaume Pagès
2015-06-09 15:02   ` Matthieu Moy
2015-06-09 18:07     ` Junio C Hamano
2015-06-09 14:42 ` [PATCH 3/4] status: give more information during rebase -i Guillaume Pagès
2015-06-09 14:42 ` [PATCH 4/4] status: add new tests for status " Guillaume Pagès
2015-06-09 15:01 ` [PATCH 1/4] status: factor two rebase-related messages together Matthieu Moy
  -- strict thread matches above, loose matches on Subject: below --
2015-06-03 22:00 Guillaume Pagès
2015-06-03 22:00 ` [PATCH 2/4] status: differentiate interactive from non-interactive rebases Guillaume Pagès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox