From: Antonio Ospite Date: Mon, 17 Dec 2018 09:03:10 +0000 (+0100) Subject: submodule-update.sh: check git version before running submodule commands X-Git-Url: https://git.ao2.it/config/vcsh.git/commitdiff_plain/6eede8729318d0419b32c0d9424297889a8e57b0?ds=sidebyside;hp=6eede8729318d0419b32c0d9424297889a8e57b0 submodule-update.sh: check git version before running submodule commands Git submodules in vcsh can only be supported reliably with git >= 2.20.0 which supports reading the .gitmodules file even when it is not checked out in the working tree. To recap, the need for git >= 2.20 is imposed by the following facts: - vcsh repositories share their working trees in $HOME; - if files with the same name (e.g. README, LICENSE) are present in different repositories they would conflict when checked out in $HOME; - sparse-checkout can solve the issue by preventing colliding files between repositories from being checked out, this includes the .gitmodules file; - submodules command require the .gitmodules file; - from git 2.20 the .gitmodules file can be accessed from the repository object store when the file is not in the working tree, this enables submodules usage with "vcsh run". Now that the version check is in place, re-enable the post-clone hook to update submodules automatically after cloning a repository. ---