@@ -188,7 +188,7 @@ with one another are rolled up.
188188Speaking of tests, Rust has a comprehensive test suite. More information about
189189it can be found [ here] [ rctd ] .
190190
191- ### External Dependencies (subrepo )
191+ ### External Dependencies (subtree )
192192
193193As a developer to this repository, you don't have to treat the following external projects
194194differently from other crates that are directly in this repo:
@@ -198,39 +198,39 @@ differently from other crates that are directly in this repo:
198198They are just regular files and directories. This is in contrast to ` submodule ` dependencies
199199(see below for those).
200200
201- If you want to synchronize or otherwise work with subrepos , install the ` git subrepo ` command via
202- instructions found at https://github.com/ingydotnet/git-subrepo
201+ If you want to synchronize or otherwise work with subtrees , install the ` git subtree ` command via
202+ instructions found at https://github.com/ingydotnet/git-subtree
203203
204- #### Synchronizing a subrepo
204+ #### Synchronizing a subtree
205205
206- There are two synchronization directions: ` subrepo push ` and ` subrepo pull ` . Both operations create
207- a synchronization commit in the rustc repo.
208- This commit is very important in order to make future synchronizations work.
209- Do not rebase this commit under any circumstances.
210- Prefer to merge in case of conflicts or redo the operation if you really need to rebase.
206+ There are two synchronization directions: ` subtree push ` and ` subtree pull ` .
211207
212- A ` git subrepo push src/tools/clippy `
208+ A ` git subtree push -P src/tools/clippy `
213209takes all the changes that
214210happened to the copy in this repo and creates commits on the remote repo that match the local
215- changes (so every local commit that touched the subrepo causes a commit on the remote repo).
211+ changes (so every local commit that touched the subtree causes a commit on the remote repo).
216212
217- A ` git subrepo pull src/tools/clippy ` takes all changes since the last ` subrepo pull` from the clippy
213+ A ` git subtree pull -P src/tools/clippy ` takes all changes since the last ` subtree pull` from the clippy
218214repo and creates a single commit in the rustc repo with all the changes.
219215
220- #### Creating a new subrepo dependency
216+ You always need to specifiy the ` -P ` prefix to the subtree directory. If you specify the wrong directory
217+ you'll get very fun merges that try to push the wrong directory to the remote repository. Luckily you
218+ can just abort this without any consequences.
221219
222- If you want to create a new subrepo dependency from an existing repository, call (from this
220+ #### Creating a new subtree dependency
221+
222+ If you want to create a new subtree dependency from an existing repository, call (from this
223223repository's root directory!!)
224224
225225```
226- git subrepo clone https://github.com/rust-lang/rust-clippy.git src/tools/clippy
226+ git subtree add -P src/tools/clippy https://github.com/rust-lang/rust-clippy.git master
227227```
228228
229229This will create a new commit, which you may not rebase under any circumstances! Delete the commit
230230and redo the operation if you need to rebase.
231231
232232Now you're done, the ` src/tools/clippy ` directory behaves as if clippy were part of the rustc
233- monorepo, so no one but you (or others that synchronize subrepos ) needs to have ` git subrepo `
233+ monorepo, so no one but you (or others that synchronize subtrees ) needs to have ` git subtree `
234234installed.
235235
236236
0 commit comments