ercp_basic.rs is written in Rust.
For branching management, this project uses
git-flow. The main
branch is
reserved for releases: the development process occurs on develop
and feature
branches. Please never commit to master.
-
Fork the repository
-
Clone your fork to a local repository:
$ git clone https://github.com/you/ercp_basic.rs.git $ cd ercp_basic.rs
-
Add the main repository as a remote:
$ git remote add upstream https://github.com/ercp/ercp_basic.rs.git
-
Checkout to
develop
:$ git checkout develop
-
Build the project:
$ cd ercp_basic.rs $ cargo build
-
Run the tests:
$ cargo test
All the tests should pass.
To make a change, please use this workflow:
-
Checkout to
develop
and apply the last upstream changes (use rebase, not merge!):$ git checkout develop $ git fetch --all --prune $ git rebase upstream/develop
-
For a tiny patch, create a new branch with an explicit name:
$ git checkout -b <my_branch>
Alternatively, if you are working on a feature which would need more work, you can create a feature branch with
git-flow
:$ git flow feature start <my_feature>
Note: always open an issue and ask before starting a big feature, to avoid it not beeing merged and your time lost.
-
Work on your feature (don’t forget to write tests):
# Some work $ git commit -am "My first change" # Some work $ git commit -am "My second change" ...
-
When your feature is ready, feel free to use interactive rebase so your history looks clean and is easy to follow. Then, apply the last upstream changes on
develop
to prepare integration:$ git checkout develop $ git fetch --all --prune $ git rebase upstream/develop
-
If there were commits on
develop
since the beginning of your feature branch, integrate them by rebasing if your branch has few commits, or merging if you had a long-lived branch:$ git checkout <my_feature_branch> $ git rebase develop
Note: the only case you should merge is when you are working on a big feature. If it is the case, we should have discussed this before as stated above.
-
Run the tests to ensure there is no regression and all works as expected:
$ cargo test
-
If it’s all good, open a pull request to merge your branch into the
develop
branch on the main repository.
Please format your code with rustfmt
.