sapling
sapling copied to clipboard
Any support for submodules?
Is there any support for submodules in Sapling? I make heavy use of them to prevent code duplication, and it looks like Sapling has something called a subproject, but I can't find any documentation on how to deal with it. How to proceed?
There is some unstable/experimental support. You can use regular clone, goto, etc. There is no need for --recursive - commands are recursive by default. test-git-submodule.t covers some basic operations.
But submodule is not used in internal main repos, and it was as an afterthought. So it might not play well with all commands in all cases and might crash in some cases.
If you want a more stable support you might want to wait. If you want to experiment you can do it today! Bug reports are welcomed.
I am also trialing this.
Do you know how this maps to git submodules? Is there a docs?
Sapling reads git's .gitmodules file and look at git trees to figure out submodule information. It then clone/pull/goto related repos on demand. If you use Sapling on a Git repo that already has submodules that works similarly to using git with --recursive passed to all related commands without the need to submodule init or other steps.
There is no commands to add or change new submodules yet. We haven't decided what's the right UX for this. For example, it might be reasonable to not require a submodule command, but just look at your working copy to figure out submodules, then auto-manage the .gitmodules file.
Right now there is no documentation since this is currently considered unstable.
The most common operation I had to do was to take an existing submodule and update its hash to a newer branch. Can't wait to see the submodules feature be designed.
+1 I'd also like to see submodule support. I'll experiment in the meantime.
Looks like there's official support: https://sapling-scm.com/docs/git/submodule
🥳🥳🥳