On Wed, 3 May 2023 15:53:57 -0400
Hugo Villeneuve <gob...@gmail.com> wrote:

On 5/3/23 15:15, Tassilo Horn wrote:
> Hugo Villeneuve <gob...@gmail.com> writes:
> > Hi Hugo, > >> 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.

>> Is it possible in a local .git/config to unset/delete an entry?

For those interested and having the same problem with git sendemail, here is a workaround that is working, though not very elegant, in my local .git/config:

[sendemail]
          smtpServer = alternate-mail-server.com
          smtpUser = ""
          smtpServerPort = ""
          tocmd = /usr/bin/true
          cccmd = /usr/bin/true

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/6e8aa0bb-5123-ad19-fc2a-d327625a0e9e%40gmail.com.

Reply via email to