git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Duy Nguyen <pclouds@gmail.com>
To: Max Kirillov <max@max630.net>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH v2] config.c: split some variables to $GIT_DIR/config.worktree
Date: Sun, 29 Mar 2015 08:25:33 +0700	[thread overview]
Message-ID: <CACsJy8DqgX91KYd5m3PvYSTXYdCO8YV-5R+v6LnzerS6TOr+5A@mail.gmail.com> (raw)
In-Reply-To: <20150326221906.GA6745@wheezy.local>

On Fri, Mar 27, 2015 at 5:19 AM, Max Kirillov <max@max630.net> wrote:
> On Thu, Mar 26, 2015 at 07:04:24PM +0700, Nguyễn Thái Ngọc Duy wrote:
>> When you define $GIT_DIR/info/config.worktree, which contains of
>> gitignore-style patterns (*), config variables that match these
>> patterns will be saved in $GIT_DIR/config.worktree instead of
>> $GIT_DIR/config.
>
> Should it rather be in GIT_COMMON_DIR? As far as I
> understand, its meaning is "variables which we allow to use
> per-worktree because we intend to have them different in
> different worktrees, and sure no bad issues
> can happen because this. It is not hardcored in git because
> the list is going to extend, and we'd like to allow older
> versions of git (and other git implementations) to be still
> able to understand newer repositories". So there should be
> no sense to make the list worktree-specific.

I'm not sure if "it" means $GIT_DIR/config.worktree or
$GIT_DIR/info/config.worktree. At this point $GIT_COMMON_DIR is not
involved (i.e. you can still spit config even in a normal repo).
.../info/config.worktree may be shared, I guess.

The "older versions of git (and other git implementations)" raises an
issue with this patch. Older impl just ignore config.worktree. I think
I need to bump core.repositoryformatversion up to avoid that.

> Also, probably the per-worktree variables should be searched
> for in both common config and per-worktree config, and the
> main repository should not have config.worktree, to be able
> to work with implementations which are not aware of the
> whole multiple worktrees feature. And in worktrees, if the
> variable is not defined in config.wortree, the default
> vaalue should come from common config. This though has
> downside that worktree cannot use the more global vlue for
> variable implicitly.

The main worktree may or may not use per-worktree config (it's
technically possible): if we enforce config.worktree on the main
worktree, we don't have to worry about the same variable defined in
both common and per-worktree config. Enforcing may require more work:
imagine the worktree list is updated, some in the common config may
become per-worktree and need to be moved to config.worktree.. If we
allow per-worktree vars in the common config, other worktrees should
ignore them in common config.
-- 
Duy

  reply	other threads:[~2015-03-29  1:26 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-08 13:16 [PATCH/RFD 0/3] worktree.* config keys and submodule and multiple worktrees Nguyễn Thái Ngọc Duy
2015-02-08 13:16 ` [PATCH 1/3] config.c: new config namespace worktree.* stored in $GIT_DIR/config.worktree Nguyễn Thái Ngọc Duy
2015-02-08 13:16 ` [PATCH 2/3] setup: add worktree.path to shadow core.worktree Nguyễn Thái Ngọc Duy
2015-02-08 13:16 ` [PATCH 3/3] submodule: use worktree.path instead of core.worktree Nguyễn Thái Ngọc Duy
2015-02-08 17:36 ` [PATCH/RFD 0/3] worktree.* config keys and submodule and multiple worktrees Jens Lehmann
2015-02-08 17:41   ` Jens Lehmann
2015-02-09  9:35   ` Duy Nguyen
2015-03-18 21:33   ` per-repository and per-worktree config variables Max Kirillov
2015-03-24 13:48     ` Duy Nguyen
2015-03-26 12:04       ` [PATCH v2] config.c: split some variables to $GIT_DIR/config.worktree Nguyễn Thái Ngọc Duy
2015-03-26 22:19         ` Max Kirillov
2015-03-29  1:25           ` Duy Nguyen [this message]
2015-03-30 21:26             ` Max Kirillov
2015-03-31 12:14         ` [PATCH v3] " Nguyễn Thái Ngọc Duy
2015-03-31 12:17           ` Duy Nguyen
2015-04-01 20:56           ` Max Kirillov
2015-04-03 10:30             ` Duy Nguyen
2015-04-13 23:37           ` Max Kirillov
2015-04-18 11:10             ` Duy Nguyen
2015-04-20  2:51               ` Max Kirillov
2015-04-20  3:22                 ` Duy Nguyen
2015-03-25 21:33     ` per-repository and per-worktree config variables Jens Lehmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACsJy8DqgX91KYd5m3PvYSTXYdCO8YV-5R+v6LnzerS6TOr+5A@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=Jens.Lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=max@max630.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).