Re: Saving space/network on common repos
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Dec 23, 2014, 03:12 UTC
- Message-ID
- <20141223031233.GX29365@google.com>
- In-Reply-To
- <CAGXKyzGnnt6bBEPoy4nvNn=zX0hdRHpgvsAe263apaDsVxv0dA@mail.gmail.com>
Craig Silverstein wrote:
Show 7 quoted lines
> btw, just FYI, the scheme you lay out here doesn't actually work > as-is. The problem is the config file, which has an entry like: > worktree = ../../../mysubmodule > This depends on the config file living in > ./git/modules/mysubmodule/config. But the proposed scheme moves the > config file to mysubmodule/.git/config, and the relative path is > broken.
As was pointed out to me privately, the behavior is exactly as you described and I had confused myself by looking at directory that wasn't even made with git-new-workdir. Sorry for the nonsense.
Workdirs share a single config file because information associated to branches set by "git branch --set-upstream-to", "git branch --edit-description", "git remote", and so on are stored in the config file.
The 'git checkout --to' series in "pu" avoids this problem by ignoring core.bare and core.worktree in worktrees created with 'git checkout --to'. To try it:
git clone https://kernel.googlesource.com/pub/scm/git/git
cd git
git merge 'origin/pu^{/nd/multiple-work-trees}^2'
make
PATH=$(pwd)/bin-wrappers:$PATHgit checkout --to=../experiment next
This seems like good motivation to try to get that series in good shape and release it soon.
Thanks again, Jonathan