Re: git should not use a default user.email config value
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Aug 12, 2013, 12:54 UTC
- Message-ID
- <5208DAF5.3040006@alum.mit.edu>
- In-Reply-To
- <20130812123921.GA16088@sigill.intra.peff.net>
On 08/12/2013 02:39 PM, Jeff King wrote:
Show 27 quoted lines
> On Mon, Aug 12, 2013 at 09:52:45PM +1000, Andrew Ardill wrote: > >> On 11 August 2013 02:58, Junio C Hamano <gitster@pobox.com> wrote: >>> Perhaps we need a lighter-weight mechanism >>> >>> git init --profile=open >>> git clone --profile=open git://git.kernel.org/git.git >> >> This is something I would definitely use. >> >> All of my work git directories are in a separate folder to my other >> git directories, and as such it would be extremely convenient if every >> repository under that folder defaulted to the same profile. That may >> be asking for too much though! > > 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/". > > I can see how such a thing might be useful, even though I do not have a > use for that much flexibility myself. I find myself doing this trick for > things like editor settings, but not for git config. So do not count > this necessarily as a vote for doing this; it was a fun exercise for me > that others might find useful.
We could satisfy a whole class of wishes by supporting user-wide/system-wide git hooks like
~/.githooks/{pre,post}-clone /etc/githooks/{pre,post}-clone
~/.githooks/{pre,post}-init /etc/githooks/{pre,post}-initI suppose similar functionality could be implemented via git aliases, but hook scripts are easier to install and share.
Michael
-- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/