Re: [PATCH 1/2] status: really ignore config with --porcelain
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 28, 2013, 17:37 UTC
- Message-ID
- <7vhagip25l.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7v61wyrikr.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 13 quoted lines
> Jeff King <peff@peff.net> writes:
>
>> You lose the assertion that finalize_deferred_config has been called,
>> but I think the resulting code would be simpler, as it drops this
>> die("BUG") state entirely. Am I missing something?
>
> Probably not. Depending on "-z", NONE is sometimes converted to
> PORCELAIN and sometimes left as-is. I originally wanted to keep the
> "unspecified" state as long as possible so that this deferred config
> logic and the "-z" default logic can be kept separate.
>
> The final patch ended up folding that "-z" default logic into the
> same function, so it probably is saner to remove UNSPECIFIED.Actually, the code needs to be able to differentiate between
git status --no-short
git statusthe former telling us explicitly to defeat status.short while the latter telling us to use whatever random value we happen to have in the configuration. Initializing the variable to UNSPECIFIED is one way to achieve that, as the former will explicitly set it to NONE while the latter will leave it UNSPECIFIED when the command line parsing finishes.