On 5/4/23 10:59, Konstantin Khomoutov wrote:
On Wed, May 03, 2023 at 03:53:57PM -0400, Hugo Villeneuve wrote:
[...]
I have a global git settings in /etc/git/config that I use for most of
my projects:
[sendemail]
smtpUser = my-username
smtpServer = mail.my-server.com
smtpServerPort = 2525
tocmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
--norolestats --nol"
cccmd ="`pwd`/scripts/get_maintainer.pl --nogit --nogit-fallback
--norolestats --nom"
However, for a particular project, I must use a different sendemail
configuration. I have added this to my .git/config file in this
project:
[sendemail]
smtpServer = alternate-mail-server.com
For this, I do not want to use the global entries like smtpUser,
tocmd, etc. Unfortunately, these entries are set to the default value
in /etc/config.
Yes, but you could explicitly set them to empty strings in your
project's .git/config.
Hi Tassilo,
no, I tried it and it doesn't work.
Setting an entry to an empty string is not the same as having this entry
"not defined" for some applications.
For example, if you look at the git sendemail source code, you will see take
a different action is taken depending if the "tocmd" entry is undefined or
is set to an empty string.
[...]
The git-send-email manual page [1] mentions the possibility of having named
"identities" for sending mail - the sendemail.identity configuration variable
and the "namespaced" settings «sendemail.<identity>.*».
Wouldn't it be possible to (ab)use this mechainsm in the following way:
* In the global configuration, have the default settings in a named
identity, as well as having the sendemail.identity set to the name of that
identity - something like
sendemail.default.smtpUser = my-username
...
sendemail.identity = default
* The local configuration might possibly be just left as is or, if that does
not work, you could define it in a way similar to the global one, but
involving a differently-named identity - such as "local".
Please note that I do not even have git-send-email installed, so all of the
above is plain guessing.
1. https://git-scm.com/docs/git-send-email
Hi,
yes, it works, but it means that I must rename the default identity
[sendemail] to something like [sendemail.default] like you suggested.
But doing so means that for every project that needs to use the default
identity, I must now pass the command line option "--identity default"
when using git sendemail, which I find inconvenient and also
incompatible with some automated scripts I have developped to call git
sendemail.
Thank you for your suggestion though, worth knowing anyway.
Hugo.
--
You received this message because you are subscribed to the Google Groups "Git for
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/git-users/fdc48311-b7a0-c0e2-63f3-5be4416e4c48%40gmail.com.