@@ -5,7 +5,7 @@ Backports in Clippy are rare and should be approved by the Clippy team. For
55example, a backport is done, if a crucial ICE was fixed or a lint is broken to a
66point, that it has to be disabled, before landing on stable.
77
8- Backports are done to the ` beta ` release of Clippy. Backports to stable Clippy
8+ Backports are done to the ` beta ` branch of Clippy. Backports to stable Clippy
99releases basically don't exist, since this would require a Rust point release,
1010which is almost never justifiable for a Clippy fix.
1111
@@ -18,7 +18,31 @@ Backports are done on the beta branch of the Clippy repository.
1818# Assuming the current directory corresponds to the Clippy repository
1919$ git checkout beta
2020$ git checkout -b backport
21- $ git cherry-pick < SHA> # `<SHA>` is the commit hash of the commit, that should be backported
21+ $ git cherry-pick < SHA> # `<SHA>` is the commit hash of the commit(s), that should be backported
22+ $ git push origin backport
23+ ```
24+
25+ Now you should test that the backport passes all the tests in the Rust
26+ repository. You can do this with:
27+
28+ ``` bash
29+ # Assuming the current directory corresponds to the Rust repository
30+ $ git checkout beta
31+ $ git subtree pull -p src/tools/clippy https://github.com/< your-github-name> /rust-clippy backport
32+ $ ./x.py test src/tools/clippy
33+ ```
34+
35+ Should the test fail, you can fix Clippy directly in the Rust repository. This
36+ has to be first applied to the Clippy beta branch and then again synced to the
37+ Rust repository, though. The easiest way to do this is:
38+
39+ ``` bash
40+ # In the Rust repository
41+ $ git diff --patch --relative=src/tools/clippy > clippy.patch
42+ # In the Clippy repository
43+ $ git apply /path/to/clippy.patch
44+ $ git add -u
45+ $ git commit -m " Fix rustup fallout"
2246$ git push origin backport
2347```
2448
@@ -29,22 +53,19 @@ After this, you can open a PR to the `beta` branch of the Clippy repository.
2953
3054This step must be done, ** after** the PR of the previous step was merged.
3155
32- After the backport landed in the Clippy repository, also the Clippy version on
33- the Rust ` beta ` branch has to be updated .
56+ After the backport landed in the Clippy repository, the branch has to be synced
57+ back to the beta branch of the Rust repository .
3458
3559``` bash
3660# Assuming the current directory corresponds to the Rust repository
3761$ git checkout beta
3862$ git checkout -b clippy_backport
39- $ pushd src/tools/clippy
40- $ git fetch
41- $ git checkout beta
42- $ popd
43- $ git add src/tools/clippy
44- § git commit -m " Update Clippy"
63+ $ git subtree pull -p src/tools/clippy https://github.com/rust-lang/rust-clippy beta
4564$ git push origin clippy_backport
4665```
4766
48- After this you can open a PR to the ` beta ` branch of the Rust repository. In
49- this PR you should tag the Clippy team member, that agreed to the backport or
50- the ` @rust-lang/clippy ` team. Make sure to add ` [beta] ` to the title of the PR.
67+ Make sure to test the backport in the Rust repository before opening a PR. This
68+ is done with ` ./x.py test src/tools/clippy ` . If that passes all tests, open a PR
69+ to the ` beta ` branch of the Rust repository. In this PR you should tag the
70+ Clippy team member, that agreed to the backport or the ` @rust-lang/clippy ` team.
71+ Make sure to add ` [beta] ` to the title of the PR.
0 commit comments