2017-11-09 22:24:42 +01:00
|
|
|
We are happy to accept contributions to OpenRAM and encourage this!
|
|
|
|
|
This document will let you know our preferred methodology for
|
|
|
|
|
including your contributions.
|
|
|
|
|
|
|
|
|
|
If you are unsure about a contribution, please email our development
|
|
|
|
|
list at openram-dev-group@ucsc.edu. We are happy to give insights into
|
|
|
|
|
the best way to implement a change to ensure your contribution will be
|
|
|
|
|
accepted and help other OpenRAM users.
|
|
|
|
|
|
|
|
|
|
# Code Style
|
|
|
|
|
|
|
|
|
|
Our code may not be the best and we acknowledge that. We welcome
|
|
|
|
|
suggested changes to our coding style, but we also encourage users
|
|
|
|
|
to follow our styles so that OpenRAM remains a cohesive codebase.
|
|
|
|
|
|
|
|
|
|
# Testing
|
|
|
|
|
|
|
|
|
|
The most important consideration is that your changes should not break
|
|
|
|
|
other OpenRAM features. Please see the README.md file on how to run
|
|
|
|
|
the unit tests. Unit tests should work in all technologies. We will run
|
|
|
|
|
the tests on your contributions before they will be accepted.
|
|
|
|
|
|
|
|
|
|
# Pull Request Process
|
|
|
|
|
|
|
|
|
|
1. One time, create a GitHub account at http://github.com
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-11-09 22:24:42 +01:00
|
|
|
2. Create a fork of the OpenRAM project on the github web page:
|
|
|
|
|
https://github.com/mguthaus/OpenRAM
|
|
|
|
|
It is on the upper right and says "Fork": This will make your own
|
|
|
|
|
OpenRAM repository on GitHub in your account.
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-11-09 22:24:42 +01:00
|
|
|
3. Clone your repository (or use an existing cloned copy if you've
|
|
|
|
|
already done this once):
|
|
|
|
|
```
|
|
|
|
|
git clone https://github.com/<youruser>/OpenRAM.git
|
|
|
|
|
cd OpenRAM
|
|
|
|
|
```
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-11-09 22:24:42 +01:00
|
|
|
4. Set up a new upstream that points to MY OpenRAM repository that you
|
|
|
|
|
forked (only first time):
|
|
|
|
|
```
|
|
|
|
|
git remote add upstream https://github.com/mguthaus/OpenRAM.git
|
|
|
|
|
```
|
|
|
|
|
You now have two remotes for this project:
|
|
|
|
|
* origin which points to your GitHub fork of the project. You can read
|
|
|
|
|
and write to this remote.
|
|
|
|
|
* upstream which points to the main project's GitHub repository. You can
|
|
|
|
|
only read from this remote.
|
|
|
|
|
You can remove remotes with
|
|
|
|
|
```
|
|
|
|
|
git remote remove upstream
|
|
|
|
|
```
|
|
|
|
|
if you previously added the one with the git@github that required
|
|
|
|
|
authentication.
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-12-13 00:50:45 +01:00
|
|
|
5. Start with dev:
|
|
|
|
|
```
|
|
|
|
|
git checkout dev
|
|
|
|
|
```
|
|
|
|
|
"dev" is the name of the branch that
|
|
|
|
|
is the development version. You should submit all contributions as changes
|
|
|
|
|
to the dev branch. "master" is the name of the branch that is the release version of the
|
|
|
|
|
code (in your fork of the repository). You can check out the released
|
|
|
|
|
code with "git checkout master”.
|
|
|
|
|
|
|
|
|
|
6. Make your own branch from dev. The number one rule is to put each piece of
|
2017-11-09 22:24:42 +01:00
|
|
|
work on its own branch:
|
|
|
|
|
```
|
|
|
|
|
git checkout -b useful-branch-name
|
|
|
|
|
```
|
|
|
|
|
Note that this is shorthand for:
|
|
|
|
|
```
|
|
|
|
|
git branch useful-branch-name
|
|
|
|
|
git checkout useful-branch-name
|
|
|
|
|
```
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-12-13 00:50:45 +01:00
|
|
|
7. Edit your code and make commits:
|
2017-11-09 22:24:42 +01:00
|
|
|
```
|
|
|
|
|
<edit files>
|
2017-12-13 00:50:45 +01:00
|
|
|
git add <new files>
|
2017-11-09 22:24:42 +01:00
|
|
|
git commit -m "Useful comment" <files changed>
|
|
|
|
|
```
|
|
|
|
|
OR (sparingly, to commit all changes):
|
|
|
|
|
```
|
|
|
|
|
git status
|
2017-12-13 00:50:45 +01:00
|
|
|
<check that all the changed files are correct and should be committed>
|
2017-11-09 22:24:42 +01:00
|
|
|
git commit -a -m "Useful comment"
|
|
|
|
|
```
|
|
|
|
|
Run the unit tests entirely. Fix all bugs.
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-12-13 00:50:45 +01:00
|
|
|
8. After you are done (or while you are editing and you see changes in
|
|
|
|
|
MY dev branch) make sure you have the most recent from MY dev
|
|
|
|
|
and merge any changes. Pull the updated copy from MY master dev in
|
2017-11-09 22:24:42 +01:00
|
|
|
MY repository:
|
|
|
|
|
```
|
2017-12-13 00:50:45 +01:00
|
|
|
git pull upstream dev
|
2017-11-09 22:24:42 +01:00
|
|
|
```
|
2017-12-13 00:50:45 +01:00
|
|
|
|
2018-02-27 00:03:03 +01:00
|
|
|
9. Frequently rebase your branch to keep track of current changes in dev.
|
2017-11-09 22:24:42 +01:00
|
|
|
```
|
2018-02-27 00:03:03 +01:00
|
|
|
git fetch upstream
|
|
|
|
|
git rebase origin/dev
|
2017-11-09 22:24:42 +01:00
|
|
|
```
|
2018-02-27 00:03:03 +01:00
|
|
|
|
|
|
|
|
10. After a final rebase and your code is working, push your branch to YOUR repository:
|
2017-11-09 22:24:42 +01:00
|
|
|
```
|
|
|
|
|
git push -u origin useful-branch-name
|
|
|
|
|
```
|
|
|
|
|
Remember origin is your copy on github and useful-branch-name is the
|
|
|
|
|
branch that you made to contain all your changes.
|
|
|
|
|
The -u flag links this branch with the remote one, so that in the
|
2017-12-13 00:50:45 +01:00
|
|
|
future, you can simply type git push origin. Do not rebase after you push
|
|
|
|
|
the branch!
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-12-13 00:50:45 +01:00
|
|
|
11. When you are done, go to GitHub and you will see a button to notify
|
2017-11-09 22:24:42 +01:00
|
|
|
me. Press the button and it will notify me of your pushed branch.
|
|
|
|
|
This will have you fill in a form for the contribution that gets sent
|
|
|
|
|
to me.
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-12-13 00:50:45 +01:00
|
|
|
12. I will review the request and may have you fix stuff if the tests
|
|
|
|
|
don't pass, you didn't merge all my changes in dev from other
|
2017-11-09 22:24:42 +01:00
|
|
|
contributions, or your style of code is bad.
|
2017-11-15 02:17:21 +01:00
|
|
|
|
2017-12-13 00:50:45 +01:00
|
|
|
13. Go back to step 3 for your next contribution. Remember, you can
|
2017-11-09 22:24:42 +01:00
|
|
|
push/pull work to your repository all the time and can pull from my
|
2017-12-13 00:50:45 +01:00
|
|
|
dev as well. Make sure to add large features so that You don't have
|
2017-11-09 22:24:42 +01:00
|
|
|
to add lots of pull requests.
|