@@ -51,6 +51,24 @@ sudo chown --reference=/usr/lib/git-core/git-subtree~ /usr/lib/git-core/git-subt
51
51
> ` bash ` instead. You can do this by editing the first line of the ` git-subtree `
52
52
> script and changing ` sh ` to ` bash ` .
53
53
54
+ ## Defining remotes
55
+
56
+ You may want to define remotes, so you don't have to type out the remote
57
+ addresses on every sync. You can do this with the following commands (these
58
+ commands still have to be run inside the ` rust ` directory):
59
+
60
+ ``` bash
61
+ # Set clippy-upstream remote for pulls
62
+ $ git remote add clippy-upstream https://github.com/rust-lang/rust-clippy
63
+ # Make sure to not push to the upstream repo
64
+ $ git remote set-url --push clippy-upstream DISABLED
65
+ # Set a local remote
66
+ $ git remote add clippy-local /path/to/rust-clippy
67
+ ```
68
+
69
+ > Note: The following sections assume that you have set those remotes with the
70
+ > above remote names.
71
+
54
72
## Performing the sync from [ ` rust-lang/rust ` ] to Clippy
55
73
56
74
Here is a TL;DR version of the sync process (all of the following commands have
@@ -64,22 +82,25 @@ to be run inside the `rust` directory):
64
82
# Make sure to change `your-github-name` to your github name in the following command. Also be
65
83
# sure to either use a net-new branch, e.g. `sync-from-rust`, or delete the branch beforehand
66
84
# because changes cannot be fast forwarded and you have to run this command again.
67
- git subtree push -P src/tools/clippy
[email protected] :your-github-name/rust-clippy sync-from-rust
85
+ git subtree push -P src/tools/clippy clippy-local sync-from-rust
68
86
```
69
87
70
- > _Note:_ This will directly push to the remote repository. You can also
71
- > push to your local copy by replacing the remote address with
72
- > ` /path/to/rust-clippy` directory.
73
-
74
88
> _Note:_ Most of the time you have to create a merge commit in the
75
89
> ` rust-clippy` repo (this has to be done in the Clippy repo, not in the
76
90
> rust-copy of Clippy):
77
91
` ` ` bash
78
92
git fetch upstream # assuming upstream is the rust-lang/rust remote
79
93
git checkout sync-from-rust
80
- git merge upstream/master
94
+ git merge upstream/master --no-ff
81
95
` ` `
82
- 4. Open a PR to ` rust-lang/rust-clippy` and wait for it to get merged (to
96
+ > Note: This is one of the few instances where a merge commit is allowed in
97
+ > a PR.
98
+ 4. Bump the nightly version in the Clippy repository by changing the date in the
99
+ rust-toolchain file to the current date and committing it with the message:
100
+ ` ` ` bash
101
+ git commit -m " Bump nightly version -> YYYY-MM-DD"
102
+ ` ` `
103
+ 5. Open a PR to ` rust-lang/rust-clippy` and wait for it to get merged (to
83
104
accelerate the process ping the ` @rust-lang/clippy` team in your PR and/or
84
105
ask them in the [Zulip] stream.)
85
106
@@ -93,33 +114,10 @@ All of the following commands have to be run inside the `rust` directory.
93
114
2. Sync the ` rust-lang/rust-clippy` master to the rust-copy of Clippy:
94
115
` ` ` bash
95
116
git checkout -b sync-from-clippy
96
- git subtree pull -P src/tools/clippy https://github.com/rust-lang/rust- clippy master
117
+ git subtree pull -P src/tools/clippy clippy-upstream master
97
118
` ` `
98
119
3. Open a PR to [` rust-lang/rust` ]
99
120
100
- # # Defining remotes
101
-
102
- You may want to define remotes, so you don' t have to type out the remote
103
- addresses on every sync. You can do this with the following commands (these
104
- commands still have to be run inside the `rust` directory):
105
-
106
- ```bash
107
- # Set clippy-upstream remote for pulls
108
- $ git remote add clippy-upstream https://github.com/rust-lang/rust-clippy
109
- # Make sure to not push to the upstream repo
110
- $ git remote set-url --push clippy-upstream DISABLED
111
- # Set clippy-origin remote to your fork for pushes
112
- $ git remote add clippy-origin [email protected] :your-github-name/rust-clippy
113
- # Set a local remote
114
- $ git remote add clippy-local /path/to/rust-clippy
115
- ```
116
-
117
- You can then sync with the remote names from above, e.g.:
118
-
119
- ```bash
120
- $ git subtree push -P src/tools/clippy clippy-local sync-from-rust
121
- ```
122
-
123
121
[gitgitgadget-pr]: https://github.com/gitgitgadget/git/pull/493
124
122
[subtree]: https://rustc-dev-guide.rust-lang.org/contributing.html#external-dependencies-subtree
125
123
[` rust-lang/rust` ]: https://github.com/rust-lang/rust
0 commit comments