Re: git should not use a default user.email config value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 12, 2013 at 11:01:03PM +1000, Andrew Ardill wrote:

> On 12 August 2013 22:39, Jeff King <peff@xxxxxxxx> wrote:
> > We could do something like the patch below, which allows:
> >
> >   $ git config --global include./magic/.path .gitconfig-magic
> >
> > to read ~/.gitconfig-magic only when we are in a repository with a
> > directory component "/magic/".
> 
> Thanks, this looks great! I'll have a play with it tomorrow.
> 
> Would locally configured config options override this one? From a
> quick read of the patch there doesn't look like there is a way of
> turning this off for a specific repository, but perhaps that is
> unnecessary. I think after a bit of use the edge cases will be a bit
> clearer.

Yes, the usual config and include rules apply; the patch just selectively
ignores the include based on the subsection regex. So if you put the
magic include in your ~/.gitconfig, anything in the repo's .git/config
will override it.

But that also means the usual restrictions apply, too. There is no way
to "unset" a variable as if it had never been specified in the first
place. And multi-valued variables will always append (e.g.,
remote.*.fetch).

The matcher is a regex, so depending on how tortured you want your regex
to get, you can probably exclude a particular directory with that. :)

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]