CONTRIBUTING.md (11977:19ba22e1e6f3) | CONTRIBUTING.md (12562:aff103c513e7) |
---|---|
1Authors: Jason Lowe-Power 2 Andreas Sandberg 3 Steve Reinhardt 4 5If you've made changes to gem5 that might benefit others, we strongly encourage 6you to contribute those changes to the public gem5 repository. There are 7several reasons to do this: 8 * Share your work with others, so that they can benefit from new functionality. --- 65 unchanged lines hidden (view full) --- 74Cloning the gem5 repo to contribute 75=================================== 76 77If you plan on contributing, it is strongly encouraged for you to clone the 78repository directly from our gerrit instance at 79https://gem5.googlesource.com/. 80 81To clone the master gem5 repository: | 1Authors: Jason Lowe-Power 2 Andreas Sandberg 3 Steve Reinhardt 4 5If you've made changes to gem5 that might benefit others, we strongly encourage 6you to contribute those changes to the public gem5 repository. There are 7several reasons to do this: 8 * Share your work with others, so that they can benefit from new functionality. --- 65 unchanged lines hidden (view full) --- 74Cloning the gem5 repo to contribute 75=================================== 76 77If you plan on contributing, it is strongly encouraged for you to clone the 78repository directly from our gerrit instance at 79https://gem5.googlesource.com/. 80 81To clone the master gem5 repository: |
82 > git clone https://gem5.googlesource.com/public/gem5 | 82``` 83 git clone https://gem5.googlesource.com/public/gem5 84``` |
83 84Other gem5 repositories 85----------------------- 86 87There are a few repositories other than the main gem5 development repository. 88 89 * public/m5threads: The code for a pthreads implementation that works with 90 gem5's syscall emulation mode. --- 76 unchanged lines hidden (view full) --- 167who has contributed a significant amount of code to the file). 168 169Note: If you do not follow these guidelines, the gerrit review site will 170automatically reject your patch. 171If this happens, update your changeset descriptions to match the required style 172and resubmit. The following is a useful git command to update the most recent 173commit (HEAD). 174 | 85 86Other gem5 repositories 87----------------------- 88 89There are a few repositories other than the main gem5 development repository. 90 91 * public/m5threads: The code for a pthreads implementation that works with 92 gem5's syscall emulation mode. --- 76 unchanged lines hidden (view full) --- 169who has contributed a significant amount of code to the file). 170 171Note: If you do not follow these guidelines, the gerrit review site will 172automatically reject your patch. 173If this happens, update your changeset descriptions to match the required style 174and resubmit. The following is a useful git command to update the most recent 175commit (HEAD). 176 |
175 > git commit --amend | 177``` 178 git commit --amend 179``` |
176 177Posting a review 178================ 179 180If you have not signed up for an account on the Gerrit review site 181(https://gem5-review.googlesource.com), you first have to create an account. 182 183Setting up an account --- 10 unchanged lines hidden (view full) --- 194a special named branch. For more information on git push see 195https://git-scm.com/docs/git-push. 196 197There are three ways to push your changes to gerrit. 198 199Push change to gerrit review 200---------------------------- 201 | 180 181Posting a review 182================ 183 184If you have not signed up for an account on the Gerrit review site 185(https://gem5-review.googlesource.com), you first have to create an account. 186 187Setting up an account --- 10 unchanged lines hidden (view full) --- 198a special named branch. For more information on git push see 199https://git-scm.com/docs/git-push. 200 201There are three ways to push your changes to gerrit. 202 203Push change to gerrit review 204---------------------------- 205 |
202 > git push origin HEAD:refs/for/master | 206``` 207 git push origin HEAD:refs/for/master 208``` |
203 204Assuming origin is https://gem5.googlesource.com/public/gem5 and you want to 205push the changeset at HEAD, this will create a new review request on top of the 206master branch. More generally, 207 | 209 210Assuming origin is https://gem5.googlesource.com/public/gem5 and you want to 211push the changeset at HEAD, this will create a new review request on top of the 212master branch. More generally, 213 |
208 > git push <gem5 gerrit instance> <changeset>:refs/for/<branch> | 214``` 215 git push <gem5 gerrit instance> <changeset>:refs/for/<branch> 216``` |
209 210See https://gerrit-review.googlesource.com/Documentation/user-upload.html for 211more information. 212 213Pushing your first change 214-------------------------- 215The first time you push a change you may get the following error: 216 | 217 218See https://gerrit-review.googlesource.com/Documentation/user-upload.html for 219more information. 220 221Pushing your first change 222-------------------------- 223The first time you push a change you may get the following error: 224 |
217 > remote: ERROR: [fb1366b] missing Change-Id in commit message footer 218 > ... | 225``` 226 remote: ERROR: [fb1366b] missing Change-Id in commit message footer 227 ... 228``` |
219 220Within the error message, there is a command line you should run. For every new 221clone of the git repo, you need to run the following command to automatically 222insert the change id in the the commit (all on one line). 223 | 229 230Within the error message, there is a command line you should run. For every new 231clone of the git repo, you need to run the following command to automatically 232insert the change id in the the commit (all on one line). 233 |
224 > curl -Lo `git rev-parse --git-dir`/hooks/commit-msg 225 https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x 226 `git rev-parse --git-dir`/hooks/commit-msg | 234``` 235 curl -Lo `git rev-parse --git-dir`/hooks/commit-msg \ 236 https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; \ 237 chmod +x `git rev-parse --git-dir`/hooks/commit-msg 238``` |
227 228If you receive the above error, simply run this command and then amend your 229changeset. 230 | 239 240If you receive the above error, simply run this command and then amend your 241changeset. 242 |
231 > git commit --amend | 243``` 244 git commit --amend 245``` |
232 233Push change to gerrit as a draft 234-------------------------------- 235 | 246 247Push change to gerrit as a draft 248-------------------------------- 249 |
236 > git push origin HEAD:refs/drafts/master | 250``` 251 git push origin HEAD:refs/drafts/master 252``` |
237 238Push change bypassing gerrit 239----------------------------- 240 241Only maintainers can bypass gerrit review. This should very rarely be used. 242 | 253 254Push change bypassing gerrit 255----------------------------- 256 257Only maintainers can bypass gerrit review. This should very rarely be used. 258 |
243 > git push origin HEAD:refs/heads/master | 259``` 260 git push origin HEAD:refs/heads/master 261``` |
244 245Other gerrit push options 246------------------------- 247 248There are a number of options you can specify when uploading your changes to 249gerrit (e.g., reviewers, labels). The gerrit documentation has more 250information. 251https://gerrit-review.googlesource.com/Documentation/user-upload.html --- 34 unchanged lines hidden (view full) --- 286Note: Whenever the patch creator updates the patch all reviewers must re-review 287the patch. There is no longer a "Fix it, then Ship It" option. 288 289Once you have received reviews for your patch, you will likely need to make 290changes. To do this, you should update the original git changeset. Then, you 291can simply push the changeset again to the same Gerrit branch to update the 292review request. 293 | 262 263Other gerrit push options 264------------------------- 265 266There are a number of options you can specify when uploading your changes to 267gerrit (e.g., reviewers, labels). The gerrit documentation has more 268information. 269https://gerrit-review.googlesource.com/Documentation/user-upload.html --- 34 unchanged lines hidden (view full) --- 304Note: Whenever the patch creator updates the patch all reviewers must re-review 305the patch. There is no longer a "Fix it, then Ship It" option. 306 307Once you have received reviews for your patch, you will likely need to make 308changes. To do this, you should update the original git changeset. Then, you 309can simply push the changeset again to the same Gerrit branch to update the 310review request. 311 |
294 > git push origin HEAD:refs/for/master | 312``` 313 git push origin HEAD:refs/for/master 314``` |
295 296Note: If you have posted a patch and don't receive any reviews, you may need to 297prod the reviewers. You can do this by adding a reply to your changeset review 298on gerrit. It is expected that at least the maintainer will supply a review for 299your patch. 300 301Committing changes 302================== 303 304Each patch must meet the following criteria to be merged: 305 * At least one review with +2 306 * At least one maintainer with +1 307 * At least +1 from the CI tests (gem5 must build and run) 308 * At least +1 from the style checker 309 310Once a patch meets the above criteria, the submitter of the patch will be able 311to merge the patch by pressing the "Submit" button on Gerrit. When the patch is 312submitted, it is merged into the public gem5 branch. | 315 316Note: If you have posted a patch and don't receive any reviews, you may need to 317prod the reviewers. You can do this by adding a reply to your changeset review 318on gerrit. It is expected that at least the maintainer will supply a review for 319your patch. 320 321Committing changes 322================== 323 324Each patch must meet the following criteria to be merged: 325 * At least one review with +2 326 * At least one maintainer with +1 327 * At least +1 from the CI tests (gem5 must build and run) 328 * At least +1 from the style checker 329 330Once a patch meets the above criteria, the submitter of the patch will be able 331to merge the patch by pressing the "Submit" button on Gerrit. When the patch is 332submitted, it is merged into the public gem5 branch. |