]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/doc/release.md
New upstream version 1.62.1+dfsg1
[rustc.git] / src / tools / clippy / doc / release.md
CommitLineData
f20569fa
XL
1# Release a new Clippy Version
2
3_NOTE: This document is probably only relevant to you, if you're a member of the
4Clippy team._
5
6Clippy is released together with stable Rust releases. The dates for these
7releases can be found at the [Rust Forge]. This document explains the necessary
8steps to create a Clippy release.
9
101. [Remerge the `beta` branch](#remerge-the-beta-branch)
112. [Update the `beta` branch](#update-the-beta-branch)
123. [Find the Clippy commit](#find-the-clippy-commit)
134. [Tag the stable commit](#tag-the-stable-commit)
145. [Update `CHANGELOG.md`](#update-changelogmd)
15
16_NOTE: This document is for stable Rust releases, not for point releases. For
17point releases, step 1. and 2. should be enough._
18
19[Rust Forge]: https://forge.rust-lang.org/
20
21
22## Remerge the `beta` branch
23
24This step is only necessary, if since the last release something was backported
25to the beta Rust release. The remerge is then necessary, to make sure that the
26Clippy commit, that was used by the now stable Rust release, persists in the
27tree of the Clippy repository.
28
29To find out if this step is necessary run
30
31```bash
32# Assumes that the local master branch is up-to-date
33$ git fetch upstream
34$ git branch master --contains upstream/beta
35```
36
37If this command outputs `master`, this step is **not** necessary.
38
39```bash
40# Assuming `HEAD` is the current `master` branch of rust-lang/rust-clippy
41$ git checkout -b backport_remerge
42$ git merge upstream/beta
43$ git diff # This diff has to be empty, otherwise something with the remerge failed
44$ git push origin backport_remerge # This can be pushed to your fork
45```
46
47After this, open a PR to the master branch. In this PR, the commit hash of the
48`HEAD` of the `beta` branch must exists. In addition to that, no files should
49be changed by this PR.
50
51
52## Update the `beta` branch
53
54This step must be done **after** the PR of the previous step was merged.
55
56First, the Clippy commit of the `beta` branch of the Rust repository has to be
57determined.
58
59```bash
60# Assuming the current directory corresponds to the Rust repository
61$ git checkout beta
62$ BETA_SHA=$(git log --oneline -- src/tools/clippy/ | grep -o "Merge commit '[a-f0-9]*' into .*" | head -1 | sed -e "s/Merge commit '\([a-f0-9]*\)' into .*/\1/g")
63```
64
65After finding the Clippy commit, the `beta` branch in the Clippy repository can
66be updated.
67
68```bash
69# Assuming the current directory corresponds to the Clippy repository
70$ git checkout beta
71$ git reset --hard $BETA_SHA
72$ git push upstream beta
73```
74
75
76## Find the Clippy commit
77
78The first step is to tag the Clippy commit, that is included in the stable Rust
79release. This commit can be found in the Rust repository.
80
81```bash
82# Assuming the current directory corresponds to the Rust repository
83$ git fetch upstream # `upstream` is the `rust-lang/rust` remote
84$ git checkout 1.XX.0 # XX should be exchanged with the corresponding version
85$ SHA=$(git log --oneline -- src/tools/clippy/ | grep -o "Merge commit '[a-f0-9]*' into .*" | head -1 | sed -e "s/Merge commit '\([a-f0-9]*\)' into .*/\1/g")
86```
87
88
89## Tag the stable commit
90
91After finding the Clippy commit, it can be tagged with the release number.
92
93```bash
94# Assuming the current directory corresponds to the Clippy repository
95$ git checkout $SHA
96$ git tag rust-1.XX.0 # XX should be exchanged with the corresponding version
17df50a5 97$ git push upstream rust-1.XX.0 # `upstream` is the `rust-lang/rust-clippy` remote
f20569fa
XL
98```
99
100After this, the release should be available on the Clippy [release page].
101
102[release page]: https://github.com/rust-lang/rust-clippy/releases
103
136023e0
XL
104## Update the `stable` branch
105
106At this step you should have already checked out the commit of the `rust-1.XX.0`
107tag. Updating the stable branch from here is as easy as:
108
109```bash
110# Assuming the current directory corresponds to the Clippy repository and the
111# commit of the just created rust-1.XX.0 tag is checked out.
112$ git push upstream rust-1.XX.0:stable # `upstream` is the `rust-lang/rust-clippy` remote
113```
114
115_NOTE: Usually there are no stable backports for Clippy, so this update should
116be possible without force pushing or anything like this. If there should have
117happened a stable backport, make sure to re-merge those changes just as with the
118`beta` branch._
f20569fa
XL
119
120## Update `CHANGELOG.md`
121
122For this see the document on [how to update the changelog].
123
04454e1e
FG
124If you don't have time to do a complete changelog update right away, just update
125the following parts:
126
127- Remove the `(beta)` from the new stable version:
128
129 ```markdown
130 ## Rust 1.XX (beta) -> ## Rust 1.XX
131 ```
132
133- Update the release date line of the new stable version:
134
135 ```markdown
136 Current beta, release 20YY-MM-DD -> Current stable, released 20YY-MM-DD
137 ```
138
139- Update the release date line of the previous stable version:
140
141 ```markdown
142 Current stable, released 20YY-MM-DD -> Released 20YY-MM-DD
143 ```
144
f20569fa 145[how to update the changelog]: https://github.com/rust-lang/rust-clippy/blob/master/doc/changelog_update.md