git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Konstantinos Dalamagkidis <konstantinos@dalamagkidis.info>
Cc: git@vger.kernel.org
Subject: Re: git-send-email does not use conditional configuration
Date: Wed, 11 Sep 2019 10:08:33 -0400	[thread overview]
Message-ID: <20190911140833.GA13916@sigill.intra.peff.net> (raw)
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?

> 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

  reply	other threads:[~2019-09-11 14:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-11  6:14 git-send-email does not use conditional configuration Konstantinos Dalamagkidis
2019-09-11 14:08 ` Jeff King [this message]
2019-09-11 16:58   ` Konstantinos Dalamagkidis
2019-09-11 18:05     ` Git.pm normalizes $GIT_DIR, was " Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190911140833.GA13916@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=konstantinos@dalamagkidis.info \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).