Re: [PATCH] worktree: add per-worktree config files
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 23, 2018, 20:47 UTC
- Message-ID
- <CAPig+cR4d3p=PoLAC=0Pss64tBa1eVq3Zz2a70spmc6Vb=cUdw@mail.gmail.com>
- In-Reply-To
- <20180923170438.23610-1-pclouds@gmail.com>
On Sun, Sep 23, 2018 at 1:04 PM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 9 quoted lines
> 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 > effective only in main worktree, is gone. These config files are > supposed to be in config.worktree.
"These config _settings_ are supposed to be..."
Show 9 quoted lines
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> > --- > diff --git a/Documentation/config.txt b/Documentation/config.txt > @@ -2,8 +2,9 @@ CONFIGURATION FILE > The Git configuration file contains a number of variables that affect > -the Git commands' behavior. The `.git/config` file in each repository > -is used to store the configuration for that repository, and > +the Git commands' behavior. The files `.git/config` and optionally > +`config.worktree` (see `extensions.worktreeConfig` below) are each
s/are/in/
Show 6 quoted lines
> +repository is used to store the configuration for that repository, and
> `$HOME/.gitconfig` is used to store a per-user configuration as
> diff --git a/t/t2029-worktree-config.sh b/t/t2029-worktree-config.sh
> @@ -0,0 +1,82 @@
> +cmp_config() {
> + if [ "$1" = "-C" ]; thenStyle:
if test "$1" = "-C"
then
...Show 5 quoted lines
> +} > + > +test_expect_success 'setup' ' > + test_commit start && > + git config --worktree per.worktree is-ok &&
Did you want:
cmp_config false extensions.worktreeConfig
at this point in the test or something? It's not clear what the intention is here.
Show 11 quoted lines
> + git worktree add wt1 && > + git worktree add wt2 && > + git config --worktree per.worktree is-ok && > + cmp_config true extensions.worktreeConfig > +' > +test_expect_success 'core.bare no longer for main only' ' > + git config core.bare true && > + cmp_config true core.bare && > + cmp_config -C wt1 true core.bare && > + cmp_config -C wt2 true core.bare && > + git config --unset core.bare
Should this be?
test_when_finished "git config --unset core.bare" &&
or perhaps test_config()?
> +'