git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/4] status: factor two rebase-related messages together

From
GPGuillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Date
Jun 9, 2015, 14:42 UTC
Message-ID
<1433860962-13222-1-git-send-email-guillaume.pages@ensimag.grenoble-inp.fr>
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
Next: Guillaume Pagès
Message 1 of 7 in “status: factor two rebase-related messages together”
  1. 1/4 status: factor two rebase-related messages togetherGuillaume Pagès, Jun 9, 2015
  2. 2/4 status: differentiate interactive from non-interactive rebasesGuillaume Pagès, Jun 9, 2015
  3. Matthieu MoyJun 9, 2015
  4. Junio C HamanoJun 9, 2015
  5. 3/4 status: give more information during rebase -iGuillaume Pagès, Jun 9, 2015
  6. 4/4 status: add new tests for status during rebase -iGuillaume Pagès, Jun 9, 2015
  7. Matthieu MoyJun 9, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.