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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 16, 2017 at 12:30:49AM -0400, Liam Beguin wrote:

> @@ -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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]