From bfa6dfef74926673cf555df972c72aae4f69f1a2 Mon Sep 17 00:00:00 2001
From: jyn <github@jyn.dev>
Date: Sun, 5 Feb 2023 13:09:14 -0600
Subject: [PATCH] Improve submodule help

Found in https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.E2.9C.94.20Tool.20needs.20merging.20when.20git.20pulling
---
 src/git.md | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/git.md b/src/git.md
index cac3d6534..a426157a2 100644
--- a/src/git.md
+++ b/src/git.md
@@ -238,18 +238,22 @@ Changes not staged for commit:
 no changes added to commit (use "git add" and/or "git commit -a")
 ```
 
-These changes are not changes to files: they are changes to submodules (more on
-this [later](#git-submodules)). To get rid of those, run `git submodule update`
-(or run any `x.py` command, which will automatically update the submodules).
-Note that,
-as of <!-- date-check --> Aug 2022,
+These changes are not changes to files: they are changes to submodules (more on this
+[later](#git-submodules)). To get rid of those, run `./x.py --help`, which will automatically update
+the submodules.
+
+Some submodules are not actually needed; for example, `src/llvm-project` doesn't need to be checked
+out if you're using `download-ci-llvm`.  To avoid having to keep fetching its history, you can use
+`git submodule deinit -f src/llvm-project`, which will also avoid it showing as modified again.
+
+Note that, as of <!-- date-check --> Aug 2022,
 there is a [bug][#77620] if you use worktrees,
 submodules, and `x.py` in a commit hook.
 If you run into an error like the following,
 it's not anything you did wrong:
 
 ```
-error: failed to read `/home/joshua/rustc-worktree/src/tools/miri/cargo-miri/Cargo.toml`
+error: failed to read `/home/jyn/rustc-worktree/src/tools/cargo/Cargo.toml`
 
 Caused by:
   No such file or directory (os error 2)
@@ -260,8 +264,6 @@ There is a workaround in [the issue][#77620-workaround].
 [#77620]: https://github.com/rust-lang/rust/issues/77620
 [#77620-workaround]: https://github.com/rust-lang/rust/issues/77620#issuecomment-705228229
 
-(Note that as of Sept 2022 `miri` is a subtree and not a submodule.)
-
 ## Rebasing and Conflicts
 
 When you edit your code locally, you are making changes to the version of