* Feature request: read git config from parent directory
@ 2016-12-08 19:49 Dominique Dumont
2016-12-09 12:38 ` Duy Nguyen
0 siblings, 1 reply; 3+ messages in thread
From: Dominique Dumont @ 2016-12-08 19:49 UTC (permalink / raw)
To: git
Hello
I use the same machine for work and open-source contribution. In both cases, I
deal with a lot of repositories. Depending on whether I commit for work or
open-source activities, I must use a different mail address. I used to setup
work address for each work repo in git local config, but this is no longer
practical.
Since I use different directories for work and open-source, would it be
possible for git to read irs config also from parent directories ? I.e. setup
git to read config from ./.git/config then ../.gitconfig, ../../gitconfig until
global ~/.gitconfig.
All the best
--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Feature request: read git config from parent directory
2016-12-08 19:49 Feature request: read git config from parent directory Dominique Dumont
@ 2016-12-09 12:38 ` Duy Nguyen
2016-12-10 11:16 ` Dominique Dumont
0 siblings, 1 reply; 3+ messages in thread
From: Duy Nguyen @ 2016-12-09 12:38 UTC (permalink / raw)
To: dod; +Cc: Git Mailing List
On Fri, Dec 9, 2016 at 2:49 AM, Dominique Dumont <dod@debian.org> wrote:
> Hello
>
> I use the same machine for work and open-source contribution. In both cases, I
> deal with a lot of repositories. Depending on whether I commit for work or
> open-source activities, I must use a different mail address. I used to setup
> work address for each work repo in git local config, but this is no longer
> practical.
Sounds like the same problem I have (and the reason I came up with
conditional include [1]). Would that work for you (check out the
example part in that patch)?
It's not supported yet. I'll need to address a few comments in the
future reroll.
[1] http://public-inbox.org/git/20160712164216.24072-1-pclouds@gmail.com/
> Since I use different directories for work and open-source, would it be
> possible for git to read irs config also from parent directories ? I.e. setup
> git to read config from ./.git/config then ../.gitconfig, ../../gitconfig until
> global ~/.gitconfig.
--
Duy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Feature request: read git config from parent directory
2016-12-09 12:38 ` Duy Nguyen
@ 2016-12-10 11:16 ` Dominique Dumont
0 siblings, 0 replies; 3+ messages in thread
From: Dominique Dumont @ 2016-12-10 11:16 UTC (permalink / raw)
To: Duy Nguyen; +Cc: Git Mailing List
On Friday, 9 December 2016 19:38:05 CET Duy Nguyen wrote:
> >> Sounds like the same problem I have (and the reason I came up with
> >> conditional include [1]). Would that work for you (check out the
> >> example part in that patch)?
> >
> > If I understand correcly, I would need to set up config include in each
> > git
> > repository. This is as much work as setting up user.email in the same
> > place.
>
> Well, no. You set this up in ~/.gitconfig. If you need to add some
> settings in /abc/def/.gitconfig and expect repositories in this path
> to reach it via the parent chain, then you could write something like
>
> [include "gitdir:/abc/def/"]
> file = your-config-file
>
> in ~/.gitconfig and achieve the same effect, because all repos will
> read ~/.gitconfig, and if it finds out the repo's location is inside
> /abc/def, your-config-file will be loaded. It could contain email
> settings or whatever.
>
> So, instead of spreading .gitconfig files around and relying on
> parent-chain to reach them, you write a few filter rules in
> ~/.gitconfig to tell all the repos what to load.
oh... yes, that would solve my problem and have no impact on other user who
don't need this feature.
I do hope that the improvement you proposed will be merged.
Thanks for the explanation.
All the best
--
https://github.com/dod38fr/ -o- http://search.cpan.org/~ddumont/
http://ddumont.wordpress.com/ -o- irc: dod at irc.debian.org
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-10 11:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08 19:49 Feature request: read git config from parent directory Dominique Dumont
2016-12-09 12:38 ` Duy Nguyen
2016-12-10 11:16 ` Dominique Dumont
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).