Re: [PATCH] worktree: add per-worktree config files

2018-09-29 Thread Duy Nguyen
On Mon, Sep 24, 2018 at 4:21 PM Taylor Blau wrote: > > @@ -602,6 +605,7 @@ int cmd_config(int argc, const char **argv, const char > > *prefix) > >PARSE_OPT_STOP_AT_NON_OPTION); > > > > if (use_global_config + use_system_config + use_local_config + > > +

Re: [PATCH] worktree: add per-worktree config files

2018-09-29 Thread Duy Nguyen
On Thu, Sep 27, 2018 at 8:34 PM Ævar Arnfjörð Bjarmason wrote: > I see I'm misremembering most of the details here. I thought that if I put: > > [remote "whatever] > url = ... > > Into my ~/.gitconfig that it wouldn't work, but it does, e.g. here in my > ~/g/git: > > $ grep -A1

Re: [PATCH] worktree: add per-worktree config files

2018-09-27 Thread Duy Nguyen
On Thu, Sep 27, 2018 at 8:34 PM Ævar Arnfjörð Bjarmason wrote: > ... > > So there is some special casing of .git/config somewhere. I looked into > this ages ago, and don't remember where that's done. Thanks! At least know I have some clues to look into (and will do). -- Duy

Re: [PATCH] worktree: add per-worktree config files

2018-09-27 Thread Ævar Arnfjörð Bjarmason
On Thu, Sep 27 2018, Duy Nguyen wrote: > On Wed, Sep 26, 2018 at 8:25 PM Ævar Arnfjörð Bjarmason > wrote: >> On Sun, Sep 23 2018, Nguyễn Thái Ngọc Duy wrote: >> >> > +extensions.worktreeConfig:: >> > + If set, by default "git config" reads from both "config" and >> > +

Re: [PATCH] worktree: add per-worktree config files

2018-09-27 Thread Duy Nguyen
On Wed, Sep 26, 2018 at 8:25 PM Ævar Arnfjörð Bjarmason wrote: > On Sun, Sep 23 2018, Nguyễn Thái Ngọc Duy wrote: > > > +extensions.worktreeConfig:: > > + If set, by default "git config" reads from both "config" and > > + "config.worktree" file in that order. > > How does this interact

Re: [PATCH] worktree: add per-worktree config files

2018-09-26 Thread Ævar Arnfjörð Bjarmason
On Sun, Sep 23 2018, Nguyễn Thái Ngọc Duy wrote: > +extensions.worktreeConfig:: > + If set, by default "git config" reads from both "config" and > + "config.worktree" file in that order. How does this interact with config that's now only used if it's in .git/config? E.g. you can't set

Re: [PATCH] worktree: add per-worktree config files

2018-09-26 Thread Junio C Hamano
Duy Nguyen writes: > I believe the main selling point of multiple worktrees is sharing > refs. You could easily avoid expensive clones with --local, but > synchronizing between different clones is not very convenient. Other > than that, different worktrees tend to behave like separate clones.

Re: [PATCH] worktree: add per-worktree config files

2018-09-26 Thread Duy Nguyen
On Tue, Sep 25, 2018 at 11:26 PM Junio C Hamano wrote: > Warning: devil's advocate mode on. Oh good. I need to a good dose of sanity anyway. > Done in either way, this will confuse the users. What is the reason > why people are led to think it is a good idea to use multiple > worktrees, even

Re: [PATCH] worktree: add per-worktree config files

2018-09-25 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > This extension is most useful in multiple worktree setup because you > now have an option to store per-worktree config (which is either > .git/config.worktree for main worktree, or > .git/worktrees/xx/config.worktree for linked ones). Heh. "This is useful if you

Re: [PATCH] worktree: add per-worktree config files

2018-09-25 Thread Duy Nguyen
On Mon, Sep 24, 2018 at 4:21 PM Taylor Blau wrote: > > +cmp_config() { > > + if [ "$1" = "-C" ]; then > > + shift && > > + GD="-C $1" && > > + shift > > + else > > + GD= > > + fi && > > + echo "$1" >expected && > > + shift && > >

Re: [PATCH] worktree: add per-worktree config files

2018-09-24 Thread Taylor Blau
On Sun, Sep 23, 2018 at 07:04:38PM +0200, Nguyễn Thái Ngọc Duy wrote: > A new repo extension is added, worktreeConfig. When it is present: I was initially scratching my head at why this should be a repository extension, but... > - The special treatment for core.bare and core.worktree, to stay >

Re: [PATCH] worktree: add per-worktree config files

2018-09-23 Thread Eric Sunshine
On Sun, Sep 23, 2018 at 1:04 PM Nguyễn Thái Ngọc Duy wrote: > A new repo extension is added, worktreeConfig. When it is present: > > - Repository config reading by default includes $GIT_DIR/config _and_ >$GIT_DIR/config.worktree. "config" file remains shared in multiple >worktree setup.

[PATCH] worktree: add per-worktree config files

2018-09-23 Thread Nguyễn Thái Ngọc Duy
A new repo extension is added, worktreeConfig. When it is present: - Repository config reading by default includes $GIT_DIR/config _and_ $GIT_DIR/config.worktree. "config" file remains shared in multiple worktree setup. - The special treatment for core.bare and core.worktree, to stay