@@ -196,23 +196,31 @@ differently from other crates that are directly in this repo:
196
196
* none so far, see https://github.com/rust-lang/rust/issues/70651 for more info
197
197
198
198
They are just regular files and directories. This is in contrast to ` submodule ` dependencies
199
- (see below for those).
199
+ (see below for those). Only tool authors will actually use any operations here.
200
200
201
201
#### Synchronizing a subtree
202
202
203
203
There are two synchronization directions: ` subtree push ` and ` subtree pull ` .
204
204
205
- A ` git subtree push -P src/tools/clippy `
205
+ ` git subtree push -P src/tools/clippy https://github.com/rust-lang/rust-clippy.git `
206
+
206
207
takes all the changes that
207
208
happened to the copy in this repo and creates commits on the remote repo that match the local
208
209
changes (so every local commit that touched the subtree causes a commit on the remote repo).
209
210
210
- A ` git subtree pull -P src/tools/clippy ` takes all changes since the last ` subtree pull ` from the clippy
211
- repo and creates a single commit in the rustc repo with all the changes.
212
-
213
- You always need to specifiy the ` -P ` prefix to the subtree directory. If you specify the wrong directory
214
- you'll get very fun merges that try to push the wrong directory to the remote repository. Luckily you
215
- can just abort this without any consequences.
211
+ ` git subtree pull -P src/tools/clippy https://github.com/rust-lang/rust-clippy.git `
212
+ takes all changes since the last ` subtree pull ` from the clippy
213
+ repo and adds these commits to the rustc repo + a merge commit with the existing changes.
214
+ It is recommended that you always do a push before a pull, so that the merge works without conflicts.
215
+ While definitely possible to resolve conflicts during a pull, you may have to redo the conflict
216
+ resolution if your PR doesn't get merged fast enough and there are new conflicts. Do not try to
217
+ rebase the result of a ` git subtree pull ` , rebasing merge commits is a bad idea in general.
218
+
219
+ You always need to specify the ` -P ` prefix to the subtree directory and the corresponding remote
220
+ repository. If you specify the wrong directory or repository
221
+ you'll get very fun merges that try to push the wrong directory to the wrong remote repository.
222
+ Luckily you can just abort this without any consequences and try again. It is usually fairly obvious
223
+ that this is happening because you suddenly get thousands of commits that want to be synchronized.
216
224
217
225
#### Creating a new subtree dependency
218
226
0 commit comments