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

Re: [PATCH 2/3] wt-status: add optional stash status information

From
Jeff King <peff@peff.net>
Date
Jun 16, 2017, 12:14 UTC
Message-ID
<20170616121423.smdtmcmbktuit2qb@sigill.intra.peff.net>
In-Reply-To
<20170616043050.29192-3-liambeguin@gmail.com>
On Fri, Jun 16, 2017 at 12:30:49AM -0400, Liam Beguin wrote:
Show 7 quoted lines
> @@ -1642,6 +1664,8 @@ static void wt_longstatus_print(struct wt_status *s)
>  		} else
>  			printf(_("nothing to commit, working tree clean\n"));
>  	}
> +	if (!git_config_get_bool("status.showStash", &show_stash) && show_stash)
> +		wt_longstatus_print_stash_summary(s);
>  }

This feels like a funny place to look up the config. How would you override it if were to have a "--no-stash" command line option?

The usual flow is for the caller to examine the config and set up fields in the wt_status object, which are then respected here in the low-level code.

So I think you probably want to handle this in git_status_config() along with other similar variables (like "status.branch").

I don't personally insist on actually adding "--no-stash" or similar to override it from the command line (there is always "git -c status.showStash=false" in a pinch). But I have seen other reviewers (including the maintainer) ask for that in the past, so you may want to anticipate it.

-Peff
Previous: Liam BeguinNext: Junio C Hamano
Message 6 of 16 in “add stash count information to git-status command”
  1. 0/3 add stash count information to git-status commandLiam Beguin, Jun 16, 2017
  2. 1/3 stash: update documentation to use 'stash entries'Liam Beguin, Jun 16, 2017
  3. Jeff KingJun 16, 2017
  4. Junio C HamanoJun 16, 2017
  5. 2/3 wt-status: add optional stash status informationLiam Beguin, Jun 16, 2017
  6. Jeff KingJun 16, 2017
  7. Junio C HamanoJun 16, 2017
  8. 3/3 glossary: define stash entriesLiam Beguin, Jun 16, 2017
  9. Jeff KingJun 16, 2017
  10. Jeff KingJun 16, 2017
  11. Liam BeguinJun 16, 2017
  12. 0/3 add stash count information to git-status commandLiam Beguin, Jun 17, 2017
  13. 3/3 glossary: define 'stash entry'Liam Beguin, Jun 17, 2017
  14. 1/3 stash: update documentation to use 'stash entry'Liam Beguin, Jun 17, 2017
  15. 2/3 status: add optional stash count informationLiam Beguin, Jun 17, 2017
  16. Junio C HamanoJun 19, 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.