- git_modules_experience.md
- 2025.03.21
- DESCRIPTION
- INVESTIGATION
- CONSLUSION
- USAGE
- RELATED ISSUES
- DESCRIPTION
Git modules experience.
- INVESTIGATION
kernel.org:
Github:
-
svn externals replacement
: chronoxor/gil#6 -
svn complete replacement for externals
: dirk-thomas/vcstool#243 -
nested submodules detection w/o .gitmodules file
: gitextensions/gitextensions#10644 (gitextensions/gitextensions#10642) -
[Discussion] nested submodules detection w/o .gitmodules file
: ingydotnet/git-subrepo#575 -
Zip archive to include submodule
: dear-github/dear-github#214 -
[PATCH] archive: add –recurse-submodules to git-archive command
: https://git.github.io/rev_news/2022/11/30/edition-93/, https://lore.kernel.org/git/[email protected]/
Stackoverflow:
svn to git migration with nested svn:externals
: https://stackoverflow.com/questions/42793618/svn-to-git-migration-with-nested-svnexternals/56649569#56649569- SubGit details for a one time SVN to Git migration: https://stackoverflow.com/questions/79524070/git-svn-places-git-folder-in-the-same-directory-as-the-project-parent-folder-in/79525532#79525532
- CONSLUSION
Seems vcstool and the forks is the
best choice here to avoid .gitmodules
file in first place.
Discussion:
Status of vcstool
: dirk-thomas/vcstool#242
Forks:
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.
- USAGE
https://github.com/andry81/externals
- RELATED ISSUES
Changelog files organization
: https://gist.github.com/andry81/d278e6d129ca1af326eafb67470a2ae3Git branches organization
: https://gist.github.com/andry81/44bb1375ad327fa4717119784c0526a6GitHub credentials notable details and changes
: https://gist.github.com/andry81/4dc954fc98a84807195080c6d2c5bc72