git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Local unset override global options

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 12, 2010, 08:53 UTC
Message-ID
<m3pr25f3ye.fsf@localhost.localdomain>
In-Reply-To
<4BC2D9B5.6070400@drmicha.warpmail.net>
Michael J Gruber <git@drmicha.warpmail.net> writes:
Show 27 quoted lines
> Stefan Hajnoczi venit, vidit, dixit 12.04.2010 16:23:
>> On Mon, Apr 12, 2010 at 9:13 AM, Michael J Gruber
>> <git@drmicha.warpmail.net> wrote:
>>
>>> have you tried setting it to an empty value?
>> 
>> Yes I have tried it.  An empty string causes the SMTP auth Perl module
>> to choke.  It expects a non-empty username and exits with an error.
>> 
>> On my system I have patched git-send-email to perform this check:
>> 
>> if (defined $smtp_authuser and length $smtp_authuser) {
>> 
>> This works but feels like a hack.  I think unset override could be
>> useful for any git config option, not just sendemail.smtpuser.
>> 
>> I'm not familiar with git internals; do you have other suggestions for
>> solving this issue?
> 
> I don't think it's possible to ignore/unset a specific global config
> value right now, you can only change the path where that is looked for.
> I see two ways to go forward:
> 
> - Change users of the config (such as git-send-email) to treat empty
> values as unset values.
> 
> - Introduce a special value "unset" for config options.
How does special case of no value, i.e.
   [sendemail]
        smtpuser
rather than using empty value
   [sendemail]
        smtpuser = ""
work?

Also if we assume that nobody needs to have support for sendemail.smtpuser = 0, the condition could be simplified to

  if ($smtp_authuser) {
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Michael J GruberNext: Junio C Hamano
Message 5 of 14 in “Local unset override global options”
  1. Stefan HajnocziApr 10, 2010
  2. Michael J GruberApr 12, 2010
  3. Stefan HajnocziApr 12, 2010
  4. Michael J GruberApr 12, 2010
  5. Jakub NarebskiApr 12, 2010
  6. Junio C HamanoApr 12, 2010
  7. Jakub NarebskiApr 12, 2010
  8. Junio C HamanoApr 12, 2010
  9. Erik Faye-LundApr 12, 2010
  10. Jakub NarebskiApr 12, 2010
  11. Junio C HamanoApr 12, 2010
  12. Stefan HajnocziApr 12, 2010
  13. Junio C HamanoApr 12, 2010
  14. Stefan HajnocziApr 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.