Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] nested submodules detection w/o .gitmodules file #575

Closed
andry81 opened this issue Feb 3, 2023 · 1 comment
Closed

[Discussion] nested submodules detection w/o .gitmodules file #575

andry81 opened this issue Feb 3, 2023 · 1 comment

Comments

@andry81
Copy link

andry81 commented Feb 3, 2023

Just because this is relevant to your project and many others, I think I have to leave it here.

https://lore.kernel.org/git/[email protected]/

Started from:
gitextensions/gitextensions#10644

Doc refs:
https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-init--ltpathgt82308203
https://git-scm.com/docs/gitsubmodules#_active_submodules

@andry81
Copy link
Author

andry81 commented Jul 24, 2024

Seems vcstool and the forks is the best choice here to avoid .gitmodules file in first place.

Discussions:
dirk-thomas/vcstool#242

Forks:
https://github.com/aaronplusone/vcstool (https://github.com/aaronplusone/vcstool/tree/feature-sparse-checkouts)
https://github.com/MaxandreOgeret/vcstool2 (https://pypi.org/project/vcstool2/)

On another hand the .gitmodules file might be required in some circumstances and it's presence (and vcstool file too as well if hashes are used) in the default branch is not preferred, because will interfere with source files commits and may be left in the desync state because of a rewrite in a submodule, which will require a rewrite in all dependent repositories and basically is pain in arse. So better just push the .gitmodules file out of a default branch into standalone branch where you can rewrite without affecting the sources.

For example, use master branch to store sources without submodules and master-modules (or master-all) branch to store sources plus .gitmodules file to checkout default branch with head submodules or with freezed submodules. Later you can just rewrite master-modules without affecting the source files from master (there won't be merges from master-modules to master, only from master into master-modules).

This approach can use both the vcstool as a more convenient tool by default and the .gitmodules file, where it is might be required because of circumstances. For example, for a ZIP archive (Download ZIP button) as were noted here.

@andry81 andry81 closed this as completed Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant