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

Re: git-send-email does not use conditional configuration

From
Jeff King <peff@peff.net>
Date
Sep 11, 2019, 14:08 UTC
Message-ID
<20190911140833.GA13916@sigill.intra.peff.net>
In-Reply-To
<CANTPZbbLNJPEEeG8BgdDEVYS=gudz4SvqGe==28EQHXDXUxuwQ@mail.gmail.com>
On Wed, Sep 11, 2019 at 08:14:45AM +0200, Konstantinos Dalamagkidis wrote:
> In my git configuration, I have an includeif section for work
> related repositories that configures the user and sendemail
> sections.

What kind of includeIf are you using? Does it work with an unconditional include? This seems to work for me:

  $ git config --global include.path one
  $ git config --file ~/one sendemail.smtpserver one.example.com
  $ git send-email --dry-run -1 --to nobody | grep ^Server
  Server: one.example.com
  $ git config --global includeIf.gitdir:$PWD/.path two
  $ git config --file ~/two sendemail.smtpserver two.example.com
  $ git send-email --dry-run -1 --to nobody | grep ^Server
  Server: two.example.com

I.e. both unconditional and gitdir includes work for me. If you do something similar, what output do you get?

Show 7 quoted lines
> I can verify that the configuration is read correctly by git:
> 
> % git config --get-regex "sendemail.*"
> sendemail.smtpencryption tls
> sendemail.smtpserver smtp.office365.com
> sendemail.smtpserverport 587
> sendemail.smtpuser dalamagkidis@work.com

Thanks for this output. That rules out that "git config" is somehow misbehaving in a way that normal internal config lookups wouldn't.

The rest of git-config should behave the same, but you could also try:
  git config --get sendemail.smtpserver

which is what send-email will actually run (you can run send-email with GIT_TRACE=1 to see the full set of commands if you want to try them manually).

-Peff
Previous: Konstantinos DalamagkidisNext: Konstantinos Dalamagkidis
Message 2 of 4 in “git-send-email does not use conditional configuration”
  1. Konstantinos DalamagkidisSep 11, 2019
  2. Jeff KingSep 11, 2019
  3. Konstantinos DalamagkidisSep 11, 2019
  4. Git.pm normalizes $GIT_DIR, was Re: git-send-email does not use conditional configurationJeff King, Sep 11, 2019

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.