Re: git status -s -v: no override
From: Jeff King <hidden>
Date: 2016-06-15 22:51:03
On Fri, Apr 15, 2011 at 07:45:45PM -0500, Jonathan Nieder wrote:
Jeff King wrote:quoted
There is no option that means "counteract -s or --porcelain seen earlier on the command line and use the default long format", which I think is what you want.Doesn't "git status $opts --no-short --no-porcelain" work?
Hmm. That does work (with either option, or both), but it is somewhat of
an accident. There is an enum specifying the format the user wants. We
hand it to parse-options for those options, telling it that the value is
an int. Parse-options will treat --no-foo on an int as setting it to 0.
The enumeration list does not have explicit integer values, but does
happen to have the constant for the long format first, which in ANSI C
guarantees it to be 0.
So yeah, it works, but I will admit to being surprised by it. And
certainly as a user, I wouldn't have thought of that.
I think it probably should have been a tristate like:
--format={long,short,porcelain}
all along, though I don't know that it is a particularly big deal. We
can still do that if we want, and just keep --short and --porcelain as
aliases.
-Peff