Skip to content

Commit 56d0c81

Browse files
committed
s/subrepo/subtree/
1 parent 04c8191 commit 56d0c81

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

CONTRIBUTING.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ with one another are rolled up.
188188
Speaking of tests, Rust has a comprehensive test suite. More information about
189189
it can be found [here][rctd].
190190

191-
### External Dependencies (subrepo)
191+
### External Dependencies (subtree)
192192

193193
As a developer to this repository, you don't have to treat the following external projects
194194
differently from other crates that are directly in this repo:
@@ -198,39 +198,39 @@ differently from other crates that are directly in this repo:
198198
They 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`
213209
takes all the changes that
214210
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).
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
218214
repo 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
223223
repository'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

229229
This will create a new commit, which you may not rebase under any circumstances! Delete the commit
230230
and redo the operation if you need to rebase.
231231

232232
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`
234234
installed.
235235

236236

0 commit comments

Comments
 (0)