Re: How to undo previously set configuration?
- From
Jeff King <peff@peff.net>
- Date
- Apr 6, 2018, 16:15 UTC
- Message-ID
- <20180406161506.GA28093@sigill.intra.peff.net>
- In-Reply-To
- <20180406175556.5b6e16f0.olaf@aepfle.de>
On Fri, Apr 06, 2018 at 05:55:56PM +0200, Olaf Hering wrote:
Show 12 quoted lines
> > The general strategy in Git's config is that instead of "unsetting", > > you > > should overwrite with whatever value you _do_ want. So a config option > > like sendemail.smtpauth should accept some kind of empty or "none" value > > to disable auth. > > > > Most single-value config options should work this way (and if one > > doesn't, I'd say that's a bug we should fix). > > This does not work. Initially I copied the global config into the repo > and set all unwanted values to <empty>, like 'smtpuser='. Perhaps the > config parser recognized that fact, but the consumer does not?
Yes. That logic is handled by the consumer (especially in the case of send-email, which is a perl script, the code runs in a totally separate process from the config parser). Naively I'd think that:
[sendemail] smtpAuth =
would do what you want, and then we'd ignore smtpUser completely. It looks like the smtp_auth_maybe function uses perl's "defined" there, though. Perhaps it should treat the empty string the same there.
(Or maybe it's something else; I don't use send-email myself, and in a few trivial examples I couldn't get it to complain about similar config).
-Peff