git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Sonny Michaud <michaud.sonny@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH 0/1] Add stash entry count summary to short status output
Date: Thu, 31 Aug 2017 20:11:00 -0700	[thread overview]
Message-ID: <20170901031100.GI30568@aiede.mtv.corp.google.com> (raw)
In-Reply-To: <c3ac0335-4f41-40d9-00ee-2a4e115bcf7a@gmail.com>

Hi Sonny,

Sonny Michaud wrote:

> Any assistance would be greatly appreciated; I just wanted to get
> started by hacking first and asking questions later!                         

Welcome to the Git project, and sorry for the silence before.  Getting
to see what people are working on is one of the nice things about
being subscribed to this list. :)

> Subject: [PATCH 0/1] Add stash entry count summary to short status output

As Junio mentioned, this subject line may discourage casual readers.
In a one-patch series like this one, there's no need for a cover
letter: the patch's commit message should speak for itself anyway.

See the DISCUSSION section of "git help format-patch" for more details
on sending a patch for review.

You can put [RFC/PATCH] to make it clear that a patch is still a work
in progress and you're looking for early comments on it.

> this patch adds a header in the same style as the one provided by
> the --branch option when the user supplies both --show-stash and
> --short.

For next time, this information belongs in the commit message.

[...]
> This patch extends the functionality of the recently introduced
> --show-stash option to the status command, providing a header similar to
> the one displayed when using the --branch option.

Can you include an example of output in the commit message?  Also,
can you say more about the workflow this fits in?  What information
does a person expect in the output, and how does this change help a
person do what they are trying to do?

[...]
> --- a/t/t7508-status.sh
> +++ b/t/t7508-status.sh
> @@ -1619,6 +1619,11 @@ test_expect_success 'show stash info with "--show-stash"' '
>         test_i18ngrep "^Your stash currently has 1 entry$" expected_with_stash
>  '
>
> +test_expect_success 'show stash info with "--show-stash" and "--short"' '
> +       git status --show-stash --short >expected_with_stash &&
> +       test_i18ngrep "Stash entries: 2" expected_with_stash

Interesting.  The idea makes sense.

I have the same questions as Junio about how this affects --porcelain
output.

Also, could this patch also include some documentation in
Documentation/git-status.txt about the new behavior?

[...]
> --- 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);
> +       if (stash_count > 0)
> +    color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "## Stash entries: %d", stash_count);

See the "For C programs" section of Documentation/SubmittingPatches
for some formatting hints.

In the "pu" branch, there is some experimental support for helping
with that.  If you merge in the bw/git-clang-format branch from there,
you can test your patch for style errors (or for errors in that support
:)) by running "make style".

Thanks and hope that helps,
Jonathan

      parent reply	other threads:[~2017-09-01  3:11 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
2017-09-01  3:11 ` Jonathan Nieder [this message]

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=20170901031100.GI30568@aiede.mtv.corp.google.com \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=michaud.sonny@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.
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).