@@ -5,7 +5,7 @@ Backports in Clippy are rare and should be approved by the Clippy team. For
5
5
example, a backport is done, if a crucial ICE was fixed or a lint is broken to a
6
6
point, that it has to be disabled, before landing on stable.
7
7
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
9
9
releases basically don't exist, since this would require a Rust point release,
10
10
which is almost never justifiable for a Clippy fix.
11
11
@@ -18,7 +18,31 @@ Backports are done on the beta branch of the Clippy repository.
18
18
# Assuming the current directory corresponds to the Clippy repository
19
19
$ git checkout beta
20
20
$ 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"
22
46
$ git push origin backport
23
47
```
24
48
@@ -29,22 +53,19 @@ After this, you can open a PR to the `beta` branch of the Clippy repository.
29
53
30
54
This step must be done, ** after** the PR of the previous step was merged.
31
55
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 .
34
58
35
59
``` bash
36
60
# Assuming the current directory corresponds to the Rust repository
37
61
$ git checkout beta
38
62
$ 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
45
64
$ git push origin clippy_backport
46
65
```
47
66
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