Hi, thanks for answering.
>> I would like to be able to tell my users that they can simply do:
>> git clone --git-dir=_/git/module1/.git module1-url
>> git clone --git-dir=_/git/module2/.git module2-url
>> which will overlay the files from both modules into the current
>> directory, which from git's perspective is the work-tree for both
> Would there be a sensible semantics in the resulting working tree?
> Which repository would a new file in such a combined working tree
> belong to?
The developer would have to decide by way of `git add`.
Ignoring other repos' files would be done by way of local config
option `excludesfile` (.gitignore is out).
To make it easier to work with git this way, a script that creates a
subshell in the context of a repo can be done with something like
`PS1="[$1 $PS1]" GIT_DIR=_git/$1/.git bash -i" -- git would then work
as usual in that subshell for that specific repo, never leaving the
I successfully employed the above scheme with luapower packages,
which are all different and mostly unrelated libraries, but which need
to be overlaid over a common directory structure. And that's just an
example. I can think of many projects that are modularized and yet the
modules need to place many files in many places to make a working
system (web frameworks, the linux filesystem, etc.)
Currently, to clone a repo one has to do:
git config --local core.worktree ../../..
git remote add origin ssh://g...@github.com/luapower/submodule.git
git branch --track master origin/master
That's 6 commands for what could be:
git clone --git-dir=_git/submodule/.git
Or even better:
git clone --git-dirs=_git ssh://g...@github.com/luapower/submodule.git
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html