submodule-update.sh: check git version before running submodule commands
authorAntonio Ospite <ao2@ao2.it>
Mon, 17 Dec 2018 09:03:10 +0000 (10:03 +0100)
committerAntonio Ospite <ao2@ao2.it>
Mon, 17 Dec 2018 09:37:45 +0000 (10:37 +0100)
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.


No differences found