git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, Jon Loeliger <jdl@jdl.com>,
	Toolforger <toolforger@durchholz.org>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: url.<base>.insteadOf vs. submodules
Date: Wed, 22 Feb 2017 11:11:12 -0800	[thread overview]
Message-ID: <CAGZ79kYrYtxGyEji0BRoPjBhZK25vvOT5JaS_jhj1_vAre17Yw@mail.gmail.com> (raw)
In-Reply-To: <20170222185711.2kpzeypptg6deytc@sigill.intra.peff.net>

On Wed, Feb 22, 2017 at 10:57 AM, Jeff King <peff@peff.net> wrote:
> On Wed, Feb 22, 2017 at 09:36:12AM -0800, Junio C Hamano wrote:
>
>> >> My gut feeling is that we should do the selective/filtered include
>> >> Peff mentioned when a repository is known to be used as a submodule
>> >> of somebody else.
>> >
>> > Does the management of these submodue-related config values
>> > become easier if, instead of placing them in .config, we
>> > place them in a git/.context file?
>>
>> Do you mean that Git users that use submodules adopt a convention
>> where a separate file in $GIT_DIR of the toplevel superproject holds
>> pieces of configuration that are meant to be shared between the
>> superproject and across all its submodules, and the $GIT_DIR/config
>> file in submodules and the superproject all include that shared one
>> via include.path mechanism?
>>
>> That may allow us to do without being responsible for sifting of
>> configuration variables into safe and unsafe bins.
>>
>> I dunno.
>
> Hmm. I certainly like that we punt on having to decide on the "should
> this be shared with submodules" decision. That makes the end result more
> flexible, and we don't have to get into a never-ending stream of
> "whitelist this config option" patches.
>
> My only concern is that it's not as discoverable. In the situation that
> kicked off this thread, somebody put url.X.insteadOf into their
> super-project .git/config, expecting it to work in the submodules. That
> _still_ wouldn't work with this proposal. They'd have to:
>
>   1. Put it in .git/context (or whatever we call it)
>
>   2. Maybe add include.path=context in .git/config if they want the
>      config shared with the super-project (or this could be automatic?)
>
> I guess it gives _a_ solution, which is more than we have now, but it
> doesn't feel very ergonomic.

Well, currently ".git/config" is the one and only blessed way to configure
a single repo and our documentation and user expectations reflect that.
Once git-worktree takes off (which has per working tree configuration files)
it doesn't feel as obscure anymore to have multiple config files.

The working trees will share the $GIT_COMMON_DIR/config file for
all working trees and have its own config file at $GIT_DIR/config.worktree
in its respective git directories. C.f.
https://public-inbox.org/git/20170110112524.12870-2-pclouds@gmail.com/

So I could imagine that we just introduce another config file
config.submodules which is source'd by the submodules.
Then the hard part becomes to decide which config value to put
in which config file. (We'd still be left to guess where to put some initial
new configuration value. config or config.submodules. Any update of a
value can just stay in its respective file. And I don't think we'd want
to invent a config option that tells us which policy we use where to
put config options. That sounds just scary.)

  reply	other threads:[~2017-02-22 19:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19 21:12 url.<base>.insteadOf vs. submodules Toolforger
2017-02-20  9:01 ` Jeff King
2017-02-20 20:31   ` Toolforger
2017-02-20 20:52     ` Jeff King
2017-02-21  5:11       ` Toolforger
2017-02-21  7:06         ` Jeff King
2017-02-21 18:19           ` Stefan Beller
2017-02-21 23:00             ` Jeff King
2017-02-21 23:16               ` Stefan Beller
2017-02-21 23:37                 ` Junio C Hamano
2017-02-21 23:59                   ` Junio C Hamano
2017-02-22  0:07                   ` Stefan Beller
2017-02-22  2:59                     ` Junio C Hamano
2017-02-22 14:00                       ` Jon Loeliger
2017-02-22 17:36                         ` Junio C Hamano
2017-02-22 18:57                           ` Jeff King
2017-02-22 19:11                             ` Stefan Beller [this message]
2017-02-21 23:40                 ` Jeff King
2017-02-22  0:10                   ` Stefan Beller

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

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

  git send-email \
    --in-reply-to=CAGZ79kYrYtxGyEji0BRoPjBhZK25vvOT5JaS_jhj1_vAre17Yw@mail.gmail.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jdl@jdl.com \
    --cc=peff@peff.net \
    --cc=toolforger@durchholz.org \
    /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.
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).