|
| 1 | +Development process of the Accellera SystemC Common Practices library |
| 2 | +===================================================================== |
| 3 | + |
| 4 | +This document focuses on the technical aspects related to the development |
| 5 | +of the SystemC Common Practices library. |
| 6 | +Legal and formal procedures are documented at |
| 7 | + |
| 8 | +https://accellera.org/about/policies-and-procedures. |
| 9 | + |
| 10 | +--------------------------------------------------------------------- |
| 11 | +Repository setup |
| 12 | +--------------------------------------------------------------------- |
| 13 | + |
| 14 | +The central source code repository of the Accellera Common Practices library |
| 15 | +is hosted at [GitHub](https://github.com/accellera-official/). |
| 16 | +The read-only repository can be found at |
| 17 | + |
| 18 | + * https://github.com/accellera-official/systemc-common-practices |
| 19 | + |
| 20 | +### Creating a personal fork |
| 21 | + |
| 22 | +In order to contribute changes to the repository, it is recommended to create |
| 23 | +personal (or company-based) [forks][2] of the repository on GitHub and push |
| 24 | +the proposed changes (bugfixes, features, ...) there. Details of the intended |
| 25 | +work-flow are described in the next [section](#basic-branch-setup). It is |
| 26 | +convenient to add this GitHub fork as a remote to your local clone of the |
| 27 | +repository: |
| 28 | + |
| 29 | + cd <repo>/ |
| 30 | + git remote add origin [email protected]:<your-account>/<repo>.git |
| 31 | + git branch --set-upstream master origin/master |
| 32 | + |
| 33 | +Contributions to the Accellera SystemC Common Practices library should comply with the |
| 34 | +[contributing guidelines][1]. |
| 35 | + |
| 36 | +Any changes can then be pushed to GitHub using: |
| 37 | + |
| 38 | + git push [options] [<repository>] [<refspec>...] |
| 39 | + |
| 40 | + * If you omit the `<repository>`, the default destination is |
| 41 | + the remote of the current branch (or `origin`). |
| 42 | + * The `<refspec>` basically follows the format |
| 43 | + `<local-branch>:<remote-branch>`, or just `<branch>`, if |
| 44 | + both are the same. |
| 45 | + * Omitting the `<refspec>` pushes all branches with 'matching' |
| 46 | + remote branches to the repository. |
| 47 | + |
| 48 | +A basic cheat sheet containing the an overview of the general |
| 49 | +Git commands and workflow can be found [online][3]. |
| 50 | + |
| 51 | +--------------------------------------------------------------------- |
| 52 | +Development flow |
| 53 | +--------------------------------------------------------------------- |
| 54 | + |
| 55 | +### Adding a feature (set) or bug fix |
| 56 | + |
| 57 | +The development of a new contribution in form of a feature or a |
| 58 | +complex bug fix is best done in a new feature branch, which is |
| 59 | +forked and checked out from the `main` branch: |
| 60 | + |
| 61 | + git checkout -b <company>-<feature-xyz> main |
| 62 | + |
| 63 | +Then code up the new contribution. Please try to facilitate code |
| 64 | +review by other Accellera members by logically grouping your changes into |
| 65 | +one commit per addressed issue. For the commit messages, please |
| 66 | +consider to follow these suggestions: |
| 67 | + |
| 68 | +> *Note:* **Commit messages** |
| 69 | +> |
| 70 | +> Though not required, it's a good idea to begin the commit message with |
| 71 | +> a single short (less than 50 character) line summarizing the change, |
| 72 | +> followed by a blank line and then a more thorough description. Tools |
| 73 | +> that turn commits into email, for example, use the first line on the |
| 74 | +> `Subject:` line and the rest of the commit in the body. |
| 75 | +
|
| 76 | +> *Note:* **Sign-off procedure for commits** |
| 77 | +> |
| 78 | +> In order to document that contributions are submitted under the |
| 79 | +> Apache-2.0 license (see `LICENSE`), a sign-off procedure is |
| 80 | +> defined in the [contributing guidelines][1]. |
| 81 | +
|
| 82 | +During the development of the contribution, the `main` branch may |
| 83 | +receive other commits. In that case, consider rebasing the commits in |
| 84 | +your feature branch onto the `HEAD` of the `main` branch to keep the |
| 85 | +history clean. Once the contribution is ready for review by the |
| 86 | +working group, push the feature branch in your fork of the respective |
| 87 | +repository on GitHub: |
| 88 | + |
| 89 | + git push <your-github-fork-remote-name> <company>-<feature-xyz> |
| 90 | + |
| 91 | +Then, send a [pull request][4] either manually or via [GitHub][4] to |
| 92 | +initiate the code review by the Accellera working group members. |
| 93 | +The summary can be manually generated by |
| 94 | + |
| 95 | + git request-pull main [email protected]/<account>/<repo>.git \ |
| 96 | + <company-feature-xyz> |
| 97 | + |
| 98 | +To review the proposed contributions, one can either browse the |
| 99 | +repository at GitHub, or add the remote location to a local |
| 100 | +clone of the repository |
| 101 | + |
| 102 | + # add the fork to your set of "remotes" |
| 103 | + git remote add <remote-name> [email protected]/<account>/<repo>.git |
| 104 | + git fetch <remote-name> |
| 105 | + |
| 106 | + # examine differences |
| 107 | + git diff main..<remote-name>/<company-feature-xyz> |
| 108 | + git log <remote-name>/<company-feature-xyz> |
| 109 | + |
| 110 | +After the contribution is accepted, it will be merged into the |
| 111 | +`main` branch by the responsible source code maintainer. This should |
| 112 | +be done with an explicit *merge commit*, to keep the individual |
| 113 | +contributions separated: |
| 114 | + |
| 115 | + git merge --no-ff --log \ |
| 116 | + <remote-name>/<company-feature-xyz> |
| 117 | + |
| 118 | +Instead of fully merging the contribution, the maintainer may choose |
| 119 | +to cherry-pick individual commits or to rebase the feature branch on |
| 120 | +an intermittently updated `main`. He may also request additional |
| 121 | +changes to be done by the submitter. In that case, the submitter may |
| 122 | +need to merge recent changes to the `main` branch into his feature |
| 123 | +branch before carrying out the requested changes. |
| 124 | + |
| 125 | +After the contribution has been fully merged into the `main` branch, the |
| 126 | +feature branch in the local and Github fork may be deleted. |
| 127 | + |
| 128 | + git branch -d <company-feature-xyz> # delete local branch |
| 129 | + git push origin :<company-feature-xyz> # delete remote branch |
| 130 | + |
| 131 | +--------------------------------------------------------------------- |
| 132 | +Issue tracking |
| 133 | +--------------------------------------------------------------------- |
| 134 | + |
| 135 | +Open issues (bugs, cleanups, features) related to the reference |
| 136 | +implementation of SystemC Common Practices library are tracked via GitHub: |
| 137 | + |
| 138 | + * <https://github.com/accellera-official/systemc-common-practices/issues> |
| 139 | + |
| 140 | +The discussion on issues usually starts on the Accellera Working Group |
| 141 | +email reflector or during the working group meetings. After an initial |
| 142 | +consensus on the "validity" of the issue, the issue is added to the |
| 143 | +issue tracking system, a classification is done (including a target |
| 144 | +milestone), and preferably a responsible person is assigned. |
| 145 | + |
| 146 | + |
| 147 | +[1]: ../CONTRIBUTING.md "How to Contribute" |
| 148 | +[2]: https://docs.github.com/en/get-started/quickstart/fork-a-repo |
| 149 | +[3]: http://zrusin.blogspot.de/2007/09/git-cheat-sheet.html "Git Cheat Sheet" |
| 150 | +[4]: https://help.github.com/articles/using-pull-requests "Using Pull Requests - github:help" |
0 commit comments