@@ -166,15 +166,18 @@ Clippy in the `rust-lang/rust` repository.
166
166
For general information about ` subtree ` s in the Rust repository see [ Rust's
167
167
` CONTRIBUTING.md ` ] [ subtree ] .
168
168
169
- Here is a TL;DR version of the sync process:
169
+ Here is a TL;DR version of the sync process (all of the following commands have
170
+ to be run inside the ` rust ` directory):
170
171
171
- 1 . Clone the [ ` rust-lang/rust ` ] repository (all of the following commands have
172
- to be run inside the ` rust ` directory)
172
+ 1 . Clone the [ ` rust-lang/rust ` ] repository
173
173
2 . Sync the changes to the rust-copy of Clippy to your Clippy fork:
174
174
``` bash
175
175
# Make sure to change `your-github-name` to your github name in the following command
176
176
git subtree push -P src/tools/clippy
[email protected] :your-github-name/rust-clippy sync-from-rust
177
177
```
178
+ _Note:_ This will directly push to the remote repository. You can also push
179
+ to your local copy by replacing the remote address with ` /path/to/rust-clippy`
180
+ directory.
178
181
3. Open a PR to ` rust-lang/rust-clippy` and wait for it to get merged (to
179
182
accelerate the process ping the ` @rust-lang/clippy` team in your PR and/or
180
183
~ ~annoy~~ ask them in the [Discord] channel.)
@@ -185,6 +188,27 @@ Here is a TL;DR version of the sync process:
185
188
` ` `
186
189
5. Open a PR to [` rust-lang/rust` ]
187
190
191
+ Also, you may want to define remotes, so you don' t have to type out the remote
192
+ addresses on every sync. You can do this with the following commands (these
193
+ commands still have to be run inside the `rust` directory):
194
+
195
+ ```bash
196
+ # Set clippy-upstream remote for pulls
197
+ $ git remote add clippy-upstream https://github.com/rust-lang/rust-clippy
198
+ # Make sure to not push to the upstream repo
199
+ $ git remote set-url --push clippy-upstream DISABLED
200
+ # Set clippy-origin remote to your fork for pushes
201
+ $ git remote add clippy-origin [email protected] :your-github-name/rust-clippy
202
+ # Set a local remote
203
+ $ git remote add clippy-local /path/to/rust-clippy
204
+ ```
205
+
206
+ You can then sync with the remote names from above, e.g.:
207
+
208
+ ```bash
209
+ $ git subtree push -P src/tools/clippy clippy-local sync-from-rust
210
+ ```
211
+
188
212
[subtree]: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#external-dependencies-subtree
189
213
[`rust-lang/rust`]: https://github.com/rust-lang/rust
190
214
0 commit comments