Thread (1 message) 1 message, 1 author, 2017-06-16

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

From: Junio C Hamano <hidden>
Date: 2017-06-16 21:29:39

Jeff King [off-list ref] writes:
On Fri, Jun 16, 2017 at 12:30:49AM -0400, Liam Beguin wrote:
quoted
@@ -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?
Good suggestion.

This is a common mistake we saw in submissions by many new
contributors, and a good practice to avoid it is to start from a
command line option without a configuration variable.  I.e. make
sure that

    $ git status --show-stash
    $ git status --show-stash --no-show-stash

work well.  After that, add support for status.showStash and make
these also work well:

    $ git -c status.showStash=false status --show-stash
    $ git -c status.showStash=true status --no-show-stash

These two new ones need to result in command line options overriding
the configured default.

And have these four getting tested in test scripts.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help