git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>,
	Craig Silverstein <csilvers@khanacademy.org>
Cc: git@vger.kernel.org, "Jonathan Nieder" <jrnieder@gmail.com>,
	"Nguye^~n Thái Ngo.c" <pclouds@gmail.com>
Subject: Re: [PATCH] git-new-workdir: support submodules
Date: Tue, 27 Jan 2015 18:35:41 +0100	[thread overview]
Message-ID: <54C7CC6D.80906@web.de> (raw)
In-Reply-To: <xmqqtwzem776.fsf@gitster.dls.corp.google.com>

Am 26.01.2015 um 06:39 schrieb Junio C Hamano:
> Craig Silverstein <csilvers@khanacademy.org> writes:
>
>> This patch, in adding submodule support, I expect would be
>> similarly useful to people even though it, also, imposes those
>> same constraints to the submodule's config files.
>
> I would expect that you would see exactly the same issue with Duy's
> multiple work tree series.  This is not limited to new-workdir.
>
> The right way to look at this is to fix what "git submodule" does;
> its use of "config" that is shared across branches is the root cause
> of the trouble.  No other part of Git keeps data that needs to be
> per-branch (or more specifically "tied to the working tree state")
> in .git/config in such a way that leaving it stale when the working
> tree state changes breaks the system.

I'm not sure what submodule config shared across branches you are
referring to here, the only two things that submodules by default
store in .git/config are the url (to mark the submodule initialized)
and the update setting (which I believe should be copied there in
the first place, but changing that in a correct and backwards
compatible would take some effort). This means you'll init (or
deinit) a submodule in all multiple worktrees at the same time, but
having the url setting in .git/config is a feature, not a bug.

And if you are talking about the core.worktree setting in
.git/modules/<submodule_name>/config, I proposed way to get rid of
that when we moved the submodule .git directory there (but that
wasn't accepted):

    http://permalink.gmane.org/gmane.comp.version-control.git/188007

Additionally I suspect submodules are just the first to suffer,
other worktree specific config (like e.g. EOL settings) affecting
all multiple worktrees at the same time when changed in a single
worktree might easily confuse other users too.

> One way to do so might be to move the bits it stores in the config
> file to somewhere else that is more closely tied to the checkout
> state and handle that similar to .git/index and .git/HEAD when it
> comes to multiple work-trees.

Yup, the idea of separating config entries into worktree and repo
specific files sounds like the solution for these problems.

  reply	other threads:[~2015-01-27 17:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-23 21:51 [PATCH] git-new-workdir: support submodules Craig Silverstein
2015-01-24  0:48 ` Craig Silverstein
2015-01-24  1:37   ` Junio C Hamano
2015-01-25  1:47     ` Craig Silverstein
2015-01-26  4:05       ` Junio C Hamano
2015-01-26  4:57         ` Craig Silverstein
2015-01-26  5:39           ` Junio C Hamano
2015-01-27 17:35             ` Jens Lehmann [this message]
2015-01-28 10:50               ` Duy Nguyen
2015-01-28 10:53                 ` Duy Nguyen
2015-01-28 20:18                   ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2014-12-23  2:10 Craig Silverstein
2014-12-23 19:08 ` Junio C Hamano

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=54C7CC6D.80906@web.de \
    --to=jens.lehmann@web.de \
    --cc=csilvers@khanacademy.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jrnieder@gmail.com \
    --cc=pclouds@gmail.com \
    /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).