Re: [RFC PATCH 3/4] color.ui config: don't die on unknown values

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

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> Before this change git will die on any unknown color.ui values:
>
>     $ git -c color.ui=doesnotexist show
>     fatal: bad numeric config value 'doesnotexist' for 'color.ui': invalid unit

I do not think "unit" is correct, so there may be some room for
improvement.  For _this_ particular case, I agree that it is not the
end of the world if we did not color the output (because we do not
know what the 'doesnotyetexist' token from the future is trying to
tell us), but as a general principle, we should diagnose and die, if
a misconfiguration is easy to correct, than blindly go ahead and do
random things that the end-user did not expect by giving something
we do not (but they thought they do) understand.

If we really want to introduce "here is a setting you may not
understand, in which case you may safely ignore", the right way to
do so is to follow the model the index extension took, where from
the syntax of the unknown thing an old/existing code can tell if it
is optional.  Forcing all codepaths to forever ignore what they do
not understand and what they happen to think is a safe fallback is
simply being irresponsible---the existing code does not understand
the new setting so they do not even know if their "current
behaviour" as a fallback is a safe and sensible one from the point
of view of the person who asked for the feature from the future.



[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]

  Powered by Linux