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, 17:02 UTC
Message-ID
<201004121902.08345.jnareb@gmail.com>
In-Reply-To
<7v1vekn05h.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 8 quoted lines
> Jakub Narebski <jnareb@gmail.com> writes:
> 
> > How does special case of no value, i.e.
> >
> >    [sendemail]
> >         smtpuser
> 
> That is not a special case; that is "boolean true".
Well, it is "boolean true" *if* git-config is used with '--bool'.

If git-send-email.perl used "git config -l -z" to read all its config variables at once into hash, like gitweb.perl does in the git_parse_project_config() subroutine, it would be able to distinguish between those the case of no value:

    [sendemail]
         smtpuser

(in which case "exists $config{'sendemail.smptuser'}" but "not defined $config{'sendemail.smtpuser'}", and of empty value

    [sendemail]
         smtpuser = ""

(in which case it is "defined $config{'sendemail.smtpuser'}" but not true "$config{'sendemail.smtpuser'}).

But as git-send-email.perl uses Git::config to read config variables one by one (equivalent to "git config --get <variable>"), I think that also in the case of no value you would end up with $smtp_authuser defined but empty (and false).

P.S. I wonder if 'sendemail.<identity>' section and 'sendemail.identity' could help with original problem...

-- 
Jakub Narebski
Poland
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.