list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
From: Stefan Beller <>
To: "Tomasz Śniatowski" <>
Cc: Duy Nguyen <>, git <>
Subject: Re: Regression: submodule worktrees can clobber core.worktree config
Date: Thu, 10 Jan 2019 12:07:34 -0800
Message-ID: <> (raw)
In-Reply-To: <>

> I had a look at,
> and it doesn't seem to be quite all okay.
> The submodule update step of the repro (that breaks the config on 2.20) emits
> an error message instead, and leaves the config unchanged:
>    git -C b2 submodule update
>    fatal: could not set 'core.worktree' to '../../../../../../b2/a'
> It looks a bit like it's still trying to do the wrong thing, but errors out
> during the attempt (repo_config_set_worktree_gently returns false).

There is more than just that. After adding the worktrees,
(and after the first status call)

    $ cat b2/.git
gitdir: /u/git/t/trash directory.t7419-submodule-worktrees/b/.git/worktrees/b2
    $ cat b2/a/.git
gitdir: /u/git/t/trash

Are worktrees using absolute path for their gitlinks?
Submodules themselves try really hard to use relative path:

    $ cat b/a/.git
gitdir: ../.git/modules/a

> Curiously, even though it says "fatal", it will then perform the actual
> submodule update if it's required.

Oh. :/ I think we should solve that by either warning
(but that gives bad UX) or actually aborting, by adding
a "|| exit 1" in in cmd_update where we
call "git submodule--helper ensure-core-worktree".

When we run "git -C b2 submodule update", it calls
"git submodule--helper ensure-core-worktree a" which
currently would make sure that b2/a/.git points to
b2/.git/modules/a, but that is not the case as b2 and b2/a
are worktrees, whose git directories are housed in

So maybe we need to be a bit more careful and check
if b2/a/.git resolves to a worktree and if so we'd not
touch it at all (and warn about it?).

> Same behavior on master with a subset of that branch cherry-picked, that is:
> along with two others it needed to build:
> --
> Tomasz Śniatowski

  reply	other threads:[~2019-01-10 20:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 22:16 Tomasz Śniatowski
2019-01-08 23:22 ` Duy Nguyen
2019-01-09  6:40   ` Tomasz Śniatowski
2019-01-09  9:12     ` Duy Nguyen
2019-01-09 17:42 ` Stefan Beller
2019-01-09 23:57   ` Tomasz Śniatowski
2019-01-10 20:07     ` Stefan Beller [this message]
2019-01-11  0:07       ` Duy Nguyen

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:

  List information:

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

  git send-email \
    --in-reply-to='' \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ \
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone