git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@grubix.eu>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] status: show in-progress info for short status
Date: Fri, 7 Apr 2017 16:05:28 +0200	[thread overview]
Message-ID: <33eebca1-b78f-1e9c-539c-120e32ecfded@grubix.eu> (raw)
In-Reply-To: <20170406143342.14770-1-szeder.dev@gmail.com>

SZEDER Gábor venit, vidit, dixit 06.04.2017 16:33:
>> @@ -1779,6 +1780,31 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
>>  	}
>>  
>>  	color_fprintf(s->fp, header_color, "]");
>> +
>> + inprogress:
>> +	if (!s->show_inprogress)
>> +		goto conclude;
>> +	memset(&state, 0, sizeof(state));
>> +	wt_status_get_state(&state,
>> +			    s->branch && !strcmp(s->branch, "HEAD"));
>> +	if (state.merge_in_progress)
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("MERGING")));
>> +	else if (state.am_in_progress)
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("AM")));
>> +	else if (state.rebase_in_progress)
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("REBASE-m")));
>> +	else if (state.rebase_interactive_in_progress)
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("REBASE-i")));
>> +	else if (state.cherry_pick_in_progress)
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("CHERRY-PICKING")));
>> +	else if (state.revert_in_progress)
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("REVERTING")));
>> +	if (state.bisect_in_progress)
> 
> else if?

No. You can do all of the above during a bisect.

> 
>> +		color_fprintf(s->fp, header_color, "; %s", LABEL(N_("BISECTING")));
>> +	free(state.branch);
>> +	free(state.onto);
>> +	free(state.detached_from);
>> +
>>   conclude:
>>  	fputc(s->null_termination ? '\0' : '\n', s->fp);
>>  }
> 
> This reminded me of a patch that I have been using for almost two
> years now...
> 
> git-prompt.sh's similar long conditional chain to show the ongoing
> operation has an else-branch at the end showing "AM/REBASE".  Your
> patch doesn't add an equivalent branch.  Is this intentional or an
> oversight?

I go over all states that wt_status_get_state can give.

> I suppose it's intentional, because that "AM/REBASE" branch in the
> prompt seems to be unreachable (see below), but I never took the
> effort to actually check that (hence the "seems" and that's why I
> never submitted it).

Note that wt_status_get_state and the prompt script do things quite
differently.

I suppose that the prompt could make use of the in-progress info being
exposed by "git status" rather doing its on thing.

Michael

  reply	other threads:[~2017-04-07 14:05 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 13:59 [PATCH] status: show in-progress info for short status Michael J Gruber
2017-03-31 18:14 ` Junio C Hamano
2017-04-07 14:14   ` Michael J Gruber
2017-04-07 16:18   ` Jacob Keller
2017-04-13  6:09     ` Junio C Hamano
2017-04-13  7:20       ` Jacob Keller
2017-05-11  2:45         ` Junio C Hamano
2017-04-13  7:21       ` Jacob Keller
2017-04-01 13:51 ` brian m. carlson
2017-04-06 14:33 ` SZEDER Gábor
2017-04-07 14:05   ` Michael J Gruber [this message]
2017-04-13 10:43     ` SZEDER Gábor
2017-04-17  7:06 ` Junio C Hamano

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=33eebca1-b78f-1e9c-539c-120e32ecfded@grubix.eu \
    --to=git@grubix.eu \
    --cc=git@vger.kernel.org \
    --cc=szeder.dev@gmail.com \
    /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.
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 NNTP newsgroup(s).