git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / Atom feed
* Regression: submodule worktrees can clobber core.worktree config
@ 2019-01-08 22:16 Tomasz Śniatowski
  2019-01-08 23:22 ` Duy Nguyen
  2019-01-09 17:42 ` Stefan Beller
  0 siblings, 2 replies; 8+ messages in thread
From: Tomasz Śniatowski @ 2019-01-08 22:16 UTC (permalink / raw)
  To: git

After upgrading to 2.20.1 I noticed in some submodule+worktree scenarios git
will break the submodule configuration. Reproducible with:
    git init a && (cd a; touch a; git add a; git commit -ma)
    git init b && (cd b; git submodule add ../a; git commit -mb)
    git -C b worktree add ../b2
    git -C b/a worktree add ../../b2/a
    git -C b status
    git -C b2 submodule update
    git -C b status

The submodule update in the _worktree_ puts an invalid core.worktree value in
the _original_ repository submodule config (b/.git/modules/a/config), causing
the last git status to error out with:
    fatal: cannot chdir to '../../../../../../b2/a': No such file or directory
    fatal: 'git status --porcelain=2' failed in submodule a

Looking at the config file itself, the submodule update operation applies the
following change (the new path is invalid):
    -       worktree = ../../../a
    +       worktree = ../../../../../../b2/a

This worked fine on 2.19.2 (no config change, no error), and was useful to have
a worktree with (large) submodules that are also worktrees.

Bisects down to:
74d4731da1 submodule--helper: replace connect-gitdir-workingtree by
ensure-core-worktree

--
Tomasz Śniatowski

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, back to index

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 22:16 Regression: submodule worktrees can clobber core.worktree config 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
2019-01-11  0:07       ` Duy Nguyen

git@vger.kernel.org list mirror (unofficial, one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox