git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Matthieu Moy <Matthieu.Moy@imag.fr>
To: gitster@pobox.com
Cc: git@vger.kernel.org, remi.lespinet@ensimag.grenoble-inp.fr,
	guillaume.pages@ensimag.grenoble-inp.fr,
	louis--alexandre.stuber@ensimag.grenoble-inp.fr,
	antoine.delaite@ensimag.grenoble-inp.fr,
	Matthieu Moy <Matthieu.Moy@imag.fr>
Subject: [PATCH v6 1/4] status: factor two rebase-related messages together
Date: Wed,  1 Jul 2015 23:08:33 +0200	[thread overview]
Message-ID: <1435784916-15456-1-git-send-email-Matthieu.Moy@imag.fr> (raw)
In-Reply-To: <vpqk2ujoadw.fsf@anie.imag.fr>

From: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>

Signed-off-by: Guillaume Pagès <guillaume.pages@ensimag.grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
No modification.

 wt-status.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/wt-status.c b/wt-status.c
index eaed4fe..8c4b806 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1027,6 +1027,20 @@ static int split_commit_in_progress(struct wt_status *s)
 	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,
 				const char *color)
@@ -1034,14 +1048,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\")"));
@@ -1051,14 +1058,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.5.0.rc0.7.ge1edd74.dirty

  reply	other threads:[~2015-07-01 21:08 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-30 13:01 [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 1/4] status: factor two rebase-related messages together Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 3/4] status: give more information during rebase -i Matthieu Moy
2015-06-30 13:01 ` [PATCH v4 4/4] status: add new tests for status " Matthieu Moy
2015-06-30 23:03 ` [PATCH v4 0/4] More helpful 'git status' during 'rebase -i' Junio C Hamano
2015-07-01  8:12   ` Matthieu Moy
2015-07-01  8:30     ` [PATCH v5 1/4] status: factor two rebase-related messages together Matthieu Moy
2015-07-01  8:30       ` [PATCH v5 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
2015-07-01  8:30       ` [PATCH v5 3/4] status: give more information during rebase -i Matthieu Moy
2015-07-01 16:18         ` Junio C Hamano
2015-07-01 16:33           ` Eric Sunshine
2015-07-01 16:36             ` Junio C Hamano
2015-07-01 16:37               ` Eric Sunshine
2015-07-01 21:06           ` Matthieu Moy
2015-07-01 21:08             ` Matthieu Moy [this message]
2015-07-01 21:08               ` [PATCH v6 2/4] status: differentiate interactive from non-interactive rebases Matthieu Moy
2015-07-01 21:08               ` [PATCH v6 3/4] status: give more information during rebase -i Matthieu Moy
2015-07-07 22:14                 ` Junio C Hamano
2015-07-08  7:10                   ` Matthieu Moy
2015-07-01 21:08               ` [PATCH v6 4/4] status: add new tests for status " Matthieu Moy
2015-07-01 21:23             ` [PATCH v5 3/4] status: give more information " Junio C Hamano
2015-07-02  8:01               ` Matthieu Moy
2015-07-03 17:40                 ` Junio C Hamano
2015-07-02  8:10               ` Matthieu Moy
2015-07-01  8:30       ` [PATCH v5 4/4] status: add new tests for status " Matthieu Moy
  -- strict thread matches above, loose matches on Subject: below --
2015-07-06 20:56 [PATCH v6 0/4] status: give more information during rebase Matthieu Moy
2015-07-06 20:56 ` [PATCH v6 1/4] status: factor two rebase-related messages together Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435784916-15456-1-git-send-email-Matthieu.Moy@imag.fr \
    --to=matthieu.moy@imag.fr \
    --cc=antoine.delaite@ensimag.grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=guillaume.pages@ensimag.grenoble-inp.fr \
    --cc=louis--alexandre.stuber@ensimag.grenoble-inp.fr \
    --cc=remi.lespinet@ensimag.grenoble-inp.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).