gitmodules: Disable update to prevent cloning on cargo checkout (#808)

When using a `git` reference on this repo, `cargo` will unnecessarily
clone the `Vulkan-Headers` submodule (which is only needed by maintainers
together with the `generator`).  By setting the update mode to `none`
(https://git-scm.com/docs/gitmodules#Documentation/gitmodules.txt-submoduleltnamegtupdate)
this is disabled, and `git submodule update` will now also no longer
fetch/clone/update the repository unless `--checkout` is used
(https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-checkout).

I.e. running `cargo update` on a repo with a `git` dependency on `ash`:

    Updating git repository `https://github.com/ash-rs/ash`
    Skipping git submodule `https://github.com/KhronosGroup/Vulkan-Headers` due to update strategy in .gitmodules
This commit is contained in:
Marijn Suijten 2023-10-30 12:20:28 +01:00 committed by GitHub
parent f5e7606c03
commit 4180359ba7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -32,8 +32,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Checkout submodule
# Manually update submodules with --checkout because they are configured with update=none and will be skipped otherwise
run: git submodule update --recursive --init --force --checkout
- name: Run generator
run: cargo run -p generator
- name: Diff autogen result

1
.gitmodules vendored
View file

@ -1,3 +1,4 @@
[submodule "generator/Vulkan-Headers"]
path = generator/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers
update = none