@@ -188,7 +188,7 @@ with one another are rolled up.
188
188
Speaking of tests, Rust has a comprehensive test suite. More information about
189
189
it can be found [ here] [ rctd ] .
190
190
191
- ### External Dependencies (subrepo )
191
+ ### External Dependencies (subtree )
192
192
193
193
As a developer to this repository, you don't have to treat the following external projects
194
194
differently from other crates that are directly in this repo:
@@ -198,39 +198,39 @@ differently from other crates that are directly in this repo:
198
198
They are just regular files and directories. This is in contrast to ` submodule ` dependencies
199
199
(see below for those).
200
200
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
203
203
204
- #### Synchronizing a subrepo
204
+ #### Synchronizing a subtree
205
205
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 ` .
211
207
212
- A ` git subrepo push src/tools/clippy `
208
+ A ` git subtree push -P src/tools/clippy `
213
209
takes all the changes that
214
210
happened 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).
216
212
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
218
214
repo and creates a single commit in the rustc repo with all the changes.
219
215
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.
221
219
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
223
223
repository's root directory!!)
224
224
225
225
```
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
227
227
```
228
228
229
229
This will create a new commit, which you may not rebase under any circumstances! Delete the commit
230
230
and redo the operation if you need to rebase.
231
231
232
232
Now 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 `
234
234
installed.
235
235
236
236
0 commit comments