From 31915eed3a57c3f7adc3b0f06f9d6f6fd6407549 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Wed, 14 Oct 2026 13:57:27 +0200 Subject: [PATCH 1/3] Mention mostly the ability to automatically update submodules Expand docs slightly to mention that you can set up your clone to automatically keep submodules up to date. --- CONTRIBUTING.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b5a50db3d50..3180b37cfb7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,6 +22,7 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of - [Cloning the repository](#cloning-the-repository) - [Recommended clone](#recommended-clone) - [Fixing an existing clone](#fixing-an-existing-clone) + - [Updating your clone](#updating-your-clone) - [Symptoms of a bad clone](#symptoms-of-a-bad-clone) - [Development on Windows](#development-on-windows) - [Enabling git symlinks](#enabling-git-symlinks) @@ -86,6 +87,13 @@ The default `git clone` plus the submodules gives you everything you need: $ git clone --recurse-submodules https://github.com/NVIDIA/cuda-python.git ``` +To keep initialized submodules in sync on `git pull`, `git checkout`, and +`git switch`, set this default once per clone: + +```console +$ git config --local submodule.recurse true +``` + ### Fixing an existing clone If you already have a shallow clone: @@ -112,6 +120,14 @@ $ git fetch --tags upstream Keep doing this periodically — a fork that was correct when you created it will drift. +### Updating your clone + +If you did not set `git config --local submodule.recurse true`, use +`git pull --recurse-submodules` to update initialized submodules to the commits +recorded by the repository. +Newly added submodules still need initialization; see +[Fixing an existing clone](#fixing-an-existing-clone). + ### Symptoms of a bad clone Only case 3 below reports an error. The first two fail *silently*, producing a From 0f5f25e250faa2b8f824293a92b21303ed331aff Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Wed, 14 Oct 2026 09:36:19 -0700 Subject: [PATCH 2/3] Manual word-smithing --- CONTRIBUTING.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3180b37cfb7..150828a87ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -81,7 +81,7 @@ working build therefore needs all of the following: ### Recommended clone -The default `git clone` plus the submodules gives you everything you need: +Clone the repository with its submodules: ```console $ git clone --recurse-submodules https://github.com/NVIDIA/cuda-python.git @@ -94,6 +94,13 @@ To keep initialized submodules in sync on `git pull`, `git checkout`, and $ git config --local submodule.recurse true ``` +This setting can also make `git push` recurse into submodules. To keep +`git push` limited to this repository, also set this once per clone: + +```console +$ git config --local push.recurseSubmodules no +``` + ### Fixing an existing clone If you already have a shallow clone: @@ -122,11 +129,15 @@ drift. ### Updating your clone -If you did not set `git config --local submodule.recurse true`, use -`git pull --recurse-submodules` to update initialized submodules to the commits -recorded by the repository. -Newly added submodules still need initialization; see -[Fixing an existing clone](#fixing-an-existing-clone). +To update your clone and initialize any newly added submodules, run: + +```console +$ git pull --recurse-submodules && git submodule update --init +``` + +You can omit `--recurse-submodules` if you have already run +`git config --local submodule.recurse true`. The second command is usually a +no-op, but ensures that newly added submodules are initialized. ### Symptoms of a bad clone From fb4a9ddb965e4bc88cd2c906e9606b930f7b1992 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Thu, 15 Oct 2026 11:01:52 +0200 Subject: [PATCH 3/3] Apply suggestion from @seberg --- CONTRIBUTING.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 150828a87ff..75c3056a59b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -94,13 +94,6 @@ To keep initialized submodules in sync on `git pull`, `git checkout`, and $ git config --local submodule.recurse true ``` -This setting can also make `git push` recurse into submodules. To keep -`git push` limited to this repository, also set this once per clone: - -```console -$ git config --local push.recurseSubmodules no -``` - ### Fixing an existing clone If you already have a shallow clone: