Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Root .gitmodules shared between multiple yadm configurations #149
When using multiple YADM configs (
This has not been an issue for me, and I don't think this actually entails an issue in yadm, but I felt it should be brought up for future consideration and testing.
yadm-bin update-index --no-assume-unchanged yadm-bin stash push -m 'yadm submodule' .gitmodules # reference git home dir yadm-bin submodule add <blah> yadm-bin add .gitmodules # I think this is done automatically yadm-bin stash pop # maybe we can track the index from above? does it matter? yadm-bin update-index --assume-unchanged .gitmodules
This is sort-of a fundamental part of how submodules are implemented in Git. Git wants to get that information from the
The crux of the issue is that you have multiple repos sharing the same work tree. Tracking data with multiple repos contradicts one of yadm's core design principles (using a single repo). If you really want to track the data in multiple repos, you might want to try out vcsh. Although, if I remember correctly, vcsh actually has problems with submodules for the same reason.
I would be very hesitant to introduce any special handling of the submodule operation, as an effort to support multiple repositories. However, hooks could be a great way to implement your idea in a shareable way. This is exactly the kind of niche use case that hooks were implemented for.
Thanks for the information!
This behavior makes sense. It has not been a problem for me (yet) since I don't actually use git submodule (I either use plugin managers, or something like vcs-tool).
Closing this for now, as this isn't really an issue but should be known for future adventurers.