public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: "Guillaume Pagès" <guillaume.pages@ensimag•grenoble-inp.fr>
Cc: git@vger•kernel.org,
	Remi Galan <remi.galan-alfonso@ensimag•grenoble-inp.fr>,
	Remi Lespinet <remi.lespinet@ensimag•grenoble-inp.fr>,
	Louis-Alexandre Stuber 
	<louis--alexandre.stuber@ensimag•grenoble-inp.fr>,
	Antoine Delaite <antoine.delaite@ensimag•grenoble-inp.fr>,
	Matthieu Moy <Matthieu.Moy@grenoble-inp•fr>
Subject: Re: [PATCH 1/4] status: factor two rebase-related messages together
Date: Mon, 08 Jun 2015 15:00:14 -0700	[thread overview]
Message-ID: <xmqqbngp97yp.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1433368825-24617-1-git-send-email-guillaume.pages@ensimag.grenoble-inp.fr> ("Guillaume Pagès"'s message of "Thu, 4 Jun 2015 00:00:22 +0200")

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

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


Hmmm, it obviously does not break anything but it is not obvious why
this is a good change.

Is it that you wanted to have a single instance of "if on a branch,
we say 'you are rebasing that branch', otherwise we say 'you are
rebasing'"?  Even then, I am not sure if this code movement was the
best way to do so (an obvious alternative is to use a shared helper
function and call from the two arms of if/elseif/... chain).

>
> 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,

  parent reply	other threads:[~2015-06-08 22:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-03 22:00 [PATCH 1/4] status: factor two rebase-related messages together Guillaume Pagès
2015-06-03 22:00 ` [PATCH 2/4] status: differentiate interactive from non-interactive rebases Guillaume Pagès
2015-06-03 22:00 ` [PATCH 3/4] status: give more information during rebase -i Guillaume Pagès
2015-06-04  8:06   ` Matthieu Moy
2015-06-04 17:19     ` Junio C Hamano
2015-06-05 16:35       ` Guillaume Pages
2015-06-05 17:11         ` Junio C Hamano
2015-06-03 22:00 ` [PATCH 4/4] status: add new tests for status " Guillaume Pagès
2015-06-04  8:11   ` Matthieu Moy
2015-06-08 22:00 ` Junio C Hamano [this message]
2015-06-09  7:33   ` [PATCH 1/4] status: factor two rebase-related messages together Guillaume Pages
  -- strict thread matches above, loose matches on Subject: below --
2015-06-09 14:42 Guillaume Pagès
2015-06-09 15:01 ` 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

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

  git send-email \
    --in-reply-to=xmqqbngp97yp.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=Matthieu.Moy@grenoble-inp$(echo .)fr \
    --cc=antoine.delaite@ensimag$(echo .)grenoble-inp.fr \
    --cc=git@vger$(echo .)kernel.org \
    --cc=guillaume.pages@ensimag$(echo .)grenoble-inp.fr \
    --cc=louis--alexandre.stuber@ensimag$(echo .)grenoble-inp.fr \
    --cc=remi.galan-alfonso@ensimag$(echo .)grenoble-inp.fr \
    --cc=remi.lespinet@ensimag$(echo .)grenoble-inp.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox