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.

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

I've tried "git config --local --unset some.option" which actually only
deletes the some.option if it is there.  It does not add an entry with
empty value to override what's in some less specific git config.  For
that, you can do "git config --local some.option ''", i.e., pass the
empty string value yourself.

With your example, you could write something like

--8<---------------cut here---------------start------------->8---
[sendemail]
         smtpServer = alternate-mail-server.com
         smtpUser =
         smtpServerPort =
         tocmd =
         cccmd =
--8<---------------cut here---------------end--------------->8---

> I do NOT want to use an external command like 'git config' to do it.

Why?  And why "external"?  I cheated and used this command to figure out
what exactly I would need to write in the git config file.

Bye,
Tassilo

-- 
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/87a5ylusg1.fsf%40gnu.org.

Reply via email to