|
| 1 | +# Contributing |
| 2 | + |
| 3 | +When contributing to this repository, please first discuss the change you wish |
| 4 | +to make via an [issue](https://github.com/sigstore/sigstore-rs/issues). |
| 5 | + |
| 6 | +## Pull Request Process |
| 7 | + |
| 8 | +1. Create an [issue](https://github.com/sigstore/sigstore-rs/issues) |
| 9 | + outlining the fix or feature. |
| 10 | +2. Fork the sigstore-rs repository to your own github account and clone it locally. |
| 11 | +3. Hack on your changes. |
| 12 | +4. Update the README.md with details of changes to any interface, this includes new environment |
| 13 | + variables, exposed ports, useful file locations, CLI parameters and |
| 14 | + new or changed configuration values. |
| 15 | +5. Correctly format your commit message see [Commit Messages](#Commit Message Guidelines) |
| 16 | + below. |
| 17 | +6. Ensure that CI passes, if it fails, fix the failures. |
| 18 | +7. Every pull request requires a review from the [core sigstore-rs team](https://github.com/orgs/github.com/sigstore/teams/sigstore-rs-codeowners) |
| 19 | + before merging. |
| 20 | +8. If your pull request consists of more than one commit, please squash your |
| 21 | + commits as described in [Squash Commits](#Squash Commits) |
| 22 | + |
| 23 | +## Commit Message Guidelines |
| 24 | + |
| 25 | +We follow the commit formatting recommendations found on [Chris Beams' How to Write a Git Commit Message article]((https://chris.beams.io/posts/git-commit/). |
| 26 | + |
| 27 | +Well formed commit messages not only help reviewers understand the nature of |
| 28 | +the Pull Request, but also assists the release process where commit messages |
| 29 | +are used to generate release notes. |
| 30 | + |
| 31 | +A good example of a commit message would be as follows: |
| 32 | + |
| 33 | +``` |
| 34 | +Summarize changes in around 50 characters or less |
| 35 | +
|
| 36 | +More detailed explanatory text, if necessary. Wrap it to about 72 |
| 37 | +characters or so. In some contexts, the first line is treated as the |
| 38 | +subject of the commit and the rest of the text as the body. The |
| 39 | +blank line separating the summary from the body is critical (unless |
| 40 | +you omit the body entirely); various tools like `log`, `shortlog` |
| 41 | +and `rebase` can get confused if you run the two together. |
| 42 | +
|
| 43 | +Explain the problem that this commit is solving. Focus on why you |
| 44 | +are making this change as opposed to how (the code explains that). |
| 45 | +Are there side effects or other unintuitive consequences of this |
| 46 | +change? Here's the place to explain them. |
| 47 | +
|
| 48 | +Further paragraphs come after blank lines. |
| 49 | +
|
| 50 | + - Bullet points are okay, too |
| 51 | +
|
| 52 | + - Typically a hyphen or asterisk is used for the bullet, preceded |
| 53 | + by a single space, with blank lines in between, but conventions |
| 54 | + vary here |
| 55 | +
|
| 56 | +If you use an issue tracker, put references to them at the bottom, |
| 57 | +like this: |
| 58 | +
|
| 59 | +Resolves: #123 |
| 60 | +See also: #456, #789 |
| 61 | +``` |
| 62 | + |
| 63 | +Note the `Resolves #123` tag, this references the issue raised and allows us to |
| 64 | +ensure issues are associated and closed when a pull request is merged. |
| 65 | + |
| 66 | +Please refer to [the github help page on message types](https://help.github.com/articles/closing-issues-using-keywords/) |
| 67 | +for a complete list of issue references. |
| 68 | + |
| 69 | +## Squash Commits |
| 70 | + |
| 71 | +Should your pull request consist of more than one commit (perhaps due to |
| 72 | +a change being requested during the review cycle), please perform a git squash |
| 73 | +once a reviewer has approved your pull request. |
| 74 | + |
| 75 | +A squash can be performed as follows. Let's say you have the following commits: |
| 76 | + |
| 77 | + initial commit |
| 78 | + second commit |
| 79 | + final commit |
| 80 | + |
| 81 | +Run the command below with the number set to the total commits you wish to |
| 82 | +squash (in our case 3 commits): |
| 83 | + |
| 84 | + git rebase -i HEAD~3 |
| 85 | + |
| 86 | +You default text editor will then open up and you will see the following:: |
| 87 | + |
| 88 | + pick eb36612 initial commit |
| 89 | + pick 9ac8968 second commit |
| 90 | + pick a760569 final commit |
| 91 | + |
| 92 | + # Rebase eb1429f..a760569 onto eb1429f (3 commands) |
| 93 | + |
| 94 | +We want to rebase on top of our first commit, so we change the other two commits |
| 95 | +to `squash`: |
| 96 | + |
| 97 | + pick eb36612 initial commit |
| 98 | + squash 9ac8968 second commit |
| 99 | + squash a760569 final commit |
| 100 | + |
| 101 | +After this, should you wish to update your commit message to better summarise |
| 102 | +all of your pull request, run: |
| 103 | + |
| 104 | + git commit --amend |
| 105 | + |
| 106 | +You will then need to force push (assuming your initial commit(s) were posted |
| 107 | +to github): |
| 108 | + |
| 109 | + git push origin your-branch --force |
| 110 | + |
| 111 | +Alternatively, a core member can squash your commits within Github. |
| 112 | +## Code of Conduct |
| 113 | + |
| 114 | +sigstore-rs adheres to and enforces the [Contributor Covenant](http://contributor-covenant.org/version/1/4/) Code of Conduct. |
| 115 | +Please take a moment to read the [CODE_OF_CONDUCT.md](https://github.com/sigstore/sigstore-rs/blob/master/CODE_OF_CONDUCT.md) document. |
0 commit comments