git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 1, 2017, 03:11 UTC
Message-ID
<20170901031100.GI30568@aiede.mtv.corp.google.com>
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?

[...]
Show 9 quoted lines
> --- 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?

[...]
Show 13 quoted lines
> --- 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

Previous: Sonny Michaud
Message 7 of 7 in “Add stash entry count summary to short status output”
  1. 0/1 Add stash entry count summary to short status outputSonny Michaud, Aug 20, 2017
  2. Sonny MichaudAug 22, 2017
  3. Sonny MichaudAug 24, 2017
  4. Junio C HamanoAug 24, 2017
  5. Junio C HamanoAug 24, 2017
  6. Sonny MichaudAug 31, 2017
  7. Jonathan NiederSep 1, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.