1 # Release a new Clippy Version
3 _NOTE: This document is probably only relevant to you, if you're a member of the
6 Clippy is released together with stable Rust releases. The dates for these
7 releases can be found at the [Rust Forge]. This document explains the necessary
8 steps to create a Clippy release.
10 1. [Remerge the `beta` branch](#remerge-the-beta-branch)
11 2. [Update the `beta` branch](#update-the-beta-branch)
12 3. [Find the Clippy commit](#find-the-clippy-commit)
13 4. [Tag the stable commit](#tag-the-stable-commit)
14 5. [Update `CHANGELOG.md`](#update-changelogmd)
16 _NOTE: This document is for stable Rust releases, not for point releases. For
17 point releases, step 1. and 2. should be enough._
19 [Rust Forge]: https://forge.rust-lang.org/
22 ## Remerge the `beta` branch
24 This step is only necessary, if since the last release something was backported
25 to the beta Rust release. The remerge is then necessary, to make sure that the
26 Clippy commit, that was used by the now stable Rust release, persists in the
27 tree of the Clippy repository.
29 To find out if this step is necessary run
32 # Assumes that the local master branch is up-to-date
34 $ git branch master --contains upstream/beta
37 If this command outputs `master`, this step is **not** necessary.
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
47 After 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
49 be changed by this PR.
52 ## Update the `beta` branch
54 This step must be done **after** the PR of the previous step was merged.
56 First, the Clippy commit of the `beta` branch of the Rust repository has to be
60 # Assuming the current directory corresponds to the Rust repository
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")
65 After finding the Clippy commit, the `beta` branch in the Clippy repository can
69 # Assuming the current directory corresponds to the Clippy repository
71 $ git reset --hard $BETA_SHA
72 $ git push upstream beta
76 ## Find the Clippy commit
78 The first step is to tag the Clippy commit, that is included in the stable Rust
79 release. This commit can be found in the Rust repository.
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")
89 ## Tag the stable commit
91 After finding the Clippy commit, it can be tagged with the release number.
94 # Assuming the current directory corresponds to the Clippy repository
96 $ git tag rust-1.XX.0 # XX should be exchanged with the corresponding version
97 $ git push upstream rust-1.XX.0 # `upstream` is the `rust-lang/rust-clippy` remote
100 After this, the release should be available on the Clippy [release page].
102 [release page]: https://github.com/rust-lang/rust-clippy/releases
104 ## Update the `stable` branch
106 At this step you should have already checked out the commit of the `rust-1.XX.0`
107 tag. Updating the stable branch from here is as easy as:
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
115 _NOTE: Usually there are no stable backports for Clippy, so this update should
116 be possible without force pushing or anything like this. If there should have
117 happened a stable backport, make sure to re-merge those changes just as with the
120 ## Update `CHANGELOG.md`
122 For this see the document on [how to update the changelog].
124 If you don't have time to do a complete changelog update right away, just update
127 - Remove the `(beta)` from the new stable version:
130 ## Rust 1.XX (beta) -> ## Rust 1.XX
133 - Update the release date line of the new stable version:
136 Current beta, release 20YY-MM-DD -> Current stable, released 20YY-MM-DD
139 - Update the release date line of the previous stable version:
142 Current stable, released 20YY-MM-DD -> Released 20YY-MM-DD
145 [how to update the changelog]: https://github.com/rust-lang/rust-clippy/blob/master/doc/changelog_update.md