Skip to content

Commit c0978c4

Browse files
authored
Using git § I changed a submodule by accident: be explicit
Rewriting git history is something that is often difficult for new contributors, and we're already explaining the `<foo>` placeholder syntax, so I think it makes sense to be explicit about what exactly the paths mean.
1 parent 4967fd2 commit c0978c4

File tree

1 file changed

+2
-1
lines changed
  • src/doc/rustc-dev-guide/src

1 file changed

+2
-1
lines changed

src/doc/rustc-dev-guide/src/git.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@ The most common cause is that you rebased after a change and ran `git add .` wit
142142
`x` to update the submodules. Alternatively, you might have run `cargo fmt` instead of `x fmt`
143143
and modified files in a submodule, then committed the changes.
144144

145-
To fix it, do the following things:
145+
To fix it, do the following things (if you changed a submodule other than cargo,
146+
replace `src/tools/cargo` with the path to that submodule):
146147

147148
1. See which commit has the accidental changes: `git log --stat -n1 src/tools/cargo`
148149
2. Revert the changes to that commit: `git checkout <my-commit>~ src/tools/cargo`. Type `~`

0 commit comments

Comments
 (0)