From: Sonny Michaud <michaud.sonny@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/1] Add stash entry count summary to short status output
Date: Thu, 31 Aug 2017 17:49:16 -0400 [thread overview]
Message-ID: <a46f972b-e83f-a08c-72ab-bfd1e7c4b310@gmail.com> (raw)
In-Reply-To: <xmqqshggvien.fsf@gitster.mtv.corp.google.com>
Junio,
I appreciate you taking the time to look over this patch. I have some
comments below before re-submitting an updated version.
On 08/24/2017 04:07 PM, Junio C Hamano wrote:
> Sonny Michaud <michaud.sonny@gmail.com> writes:
>
>> diff --git a/wt-status.c b/wt-status.c
>> index 77c27c511..651bb01f0 100644
>> --- a/wt-status.c
>> +++ b/wt-status.c
>> @@ -1827,6 +1827,15 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
>> fputc(s->null_termination ? '\0' : '\n', s->fp);
>> }
>>
>> +static void wt_shortstatus_print_stash_summary(struct wt_status *s)
>> +{
>> + int stash_count = 0;
>> +
>> + for_each_reflog_ent("refs/stash", stash_count_refs, &stash_count);
> A singleton instance of this in wt_longstatus_print_stash_summary()
> thing was OK, but let's not duplicate and spread the badness. Have
> a simple there-liner helper function "static int stash_count(void);"
> that does the above and returns the stash_count, and use it from
> both places.
That is reasonable.
>> + if (stash_count > 0)
>> + color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "## Stash entries: %d", stash_count);
> That's a funny way to indent (dedent?) a body of an if() statement.
My bad, I can clean that up!
>
> Don't scripts that read this output (I notice that this is also
> called by wt_porcelain_print() function) expect that entries that
> are led by "##" are about the current branch and its tracking
> information?
>
> This patch would break these script by adding this new line using
> the same "##" leader.
>
I did not consider porcelain output; it looks like the headers are
stripped from it, though, so this might not be an issue. Do you think
this is a worthwhile path to continue on?
Thanks,
Sonny
next prev parent reply other threads:[~2017-08-31 21:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-20 4:53 [PATCH 0/1] Add stash entry count summary to short status output Sonny Michaud
2017-08-22 15:25 ` Sonny Michaud
2017-08-24 15:29 ` Sonny Michaud
2017-08-24 19:29 ` Junio C Hamano
2017-08-24 20:07 ` Junio C Hamano
2017-08-31 21:49 ` Sonny Michaud [this message]
2017-09-01 3:11 ` Jonathan Nieder
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=a46f972b-e83f-a08c-72ab-bfd1e7c4b310@gmail.com \
--to=michaud.sonny@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).