Skip to content

Commit

Permalink
chore: Add commit tag info
Browse files Browse the repository at this point in the history
Added commit tag info, also simplified some paragraphs.
  • Loading branch information
slspencer committed Sep 20, 2020
1 parent 0724e98 commit f4150ad
Showing 1 changed file with 51 additions and 60 deletions.
111 changes: 51 additions & 60 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,73 @@
# Contributing code

We highly recommend that you read this page before you clone the repo and start making changes.
Thanks for contributing to Seamly code, documentation, translations, website, and wiki!

Our preferred workflow is based on **Git Flow**. If you use a different workflow approach keep in mind this might create extra work when creating pull requests.
Our workflow is based on **Git Flow**, outlined in the steps below.
As always, please fix only one issue at a time.
Build your branch with Qt and test, then make a pull request.

Fix one issue at a time. This allows other team members to quickly test & merge your code.
Read more about **Git Flow**: http://nvie.com/posts/a-successful-git-branching-model/
Read more about **Pull Requests**: https://help.github.com/articles/about-pull-requests/ and https://help.github.com/articles/creating-a-pull-request/

More about **Git Flow**: http://nvie.com/posts/a-successful-git-branching-model/
More about **Pull Requests**: https://help.github.com/articles/about-pull-requests/ and https://help.github.com/articles/creating-a-pull-request/
## Naming conventions

## Permanent Named branches
Name your branch after the issue you will fix. Example: Name your branch **issue-#155** for issue #155.

The permanent named branches on this repo are:
* **develop** - Contains next major release. Used for testing and sharing among developers.
* **master** - Used only for releases.
* **release-x.x.x** - Created from **develop**. Contains feature freeze state before the next major release. Used for preparing each major & minor release with updated build information. Merge to **master** with new tag to create a new release.
* **hotfix-x.x.x** - Create from **develop** and **master**. Contains a quick emergency fix for big bugs. Merge to **master** (or **release**) and **develop**.

## Git Flow summary
_These steps use Git command line_
_It's easier if you use Github Desktop https://desktop.github.com/ for Windows & Mac_
## Clone the repo & create your issue branch

### Git Flow 1 - Clone the repo

* Clone our repo to your local PC.
* Clone the repo & set the origin URL
>git clone https://github.com/fashionfreedom/seamly2d
* Set the origin URL.
>git remote set-url origin https://github.com/fashionfreedom/seamly2d
### Git Flow 2 - Create your issue branch from develop branch then switch to your issue branch
git remote set-url origin https://github.com/fashionfreedom/seamly2d

* Create your issue branch, name it after the issue you will fix: **issue-#_n_** (eg - **issue-#155** to name your fix for issue #155.)
* Create your issue branch then switch focus to your issue branch. Examples use branch for issue #155.
>git checkout develop
git checkout -b issue-#_n_
git checkout issue-#_n_
git checkout -b issue-#155
git checkout issue-#155

### GitFlow 3 - Daily workflow
## Daily workflow

* Get latest changes from the **develop** branch from our main repo before
>git pull develop issue-#_n_
git checkout issue-#_n_
* Make your code changes
* Commit your changes to issue-#_n_
* Pull latest changes from the origin **develop** branch & merge them into your issue branch
>git pull origin develop
git checkout issue-#155
git merge develop

* Make your code changes & commit your changes.
>git commit -a
git commit -m "_your commit message_"
git commit push issue-#_n_
_Note: At the next build after merging your code into the develop branch, your commit message will be automatically added to the Changelog.md file_

### GitFlow 4 - Test your issue branch (DON'T SKIP THIS STEP)

* Periodically build your issue branch. You'll need Qt 5.13.2 and Qt Creator 4.3.x with MSVC 2017 64bit or MinGW 7.3.0 64bit in your Qt project Kit.
* Run it on your local PC. Try to find how to make your changes crash before making your pull request.

### GitFLow 5 - Push your issue branch up to the main repo

* Push your branch up to our main repo
>git push -u origin issue-#_n_
* Go to **Pull Requests** and click on the green **New Pull Request** button

### GitFLow 6 - Create a Pull Request

* On the Code page in the main repo, make sure **Branch:develop** is selected.
* Click on **Pull Requests** in the main menu bar. Click on the green **New Pull Request** button.
* From the **Compare:develop** dropdown list, select your issue branch.
* In the comments box add a short description, eg "Fix issue #155" or other short description of what was done.
* On the next line optionally add additional relevant info. (eg "Tested on Windows 10 64-bit").
* Click the **Create Pull Request** button
* Link your Pull Request to the issue with **Linked Issues** in the right hand column.
* Other team members will test it on their systems and approve the Pull Request.
* The maintainer will merge your issue branch into **develop**.
* At the next build, the first line of your short description will be added to ChangeLog.md

### GitFlow 7 - Update your Pull Request

Most likely we will ask you to fix some issues in your code. In this case you would:
* Make changes locally to your **issue-#_n_** branch
* Push your **issue-#_n_** branch up to the repo again
* Update your existing pull request
* Rejoice ! :D
git commit -m "fix bug with arc and line tool issue-#155"
git commit push issue-#155

## Create a Pull Request

* Build & test your issue branch with Qt 5.13.2 & Qt Creator 4.3.x with compilers MSVC 2017, MinGW 7.3.0, gcc, or clang.

* Push your issue branch up to the github repo.
>git push -u origin issue-#155
* Select **Branch:develop** then **Pull Requests** on the repo main menu bar.
* Select the green **New Pull Request** button then select your issue branch from the **Compare:develop** dropdown list.
* Enter the Pull Request Header as "tag: description issue_" using _conventional-changelog/commit-zen-cli_ tags so your commits are auto-included in the Changelog.md file. Read more here: https://docs.changelogg.io/conventional-changelog-template. Example PR Header: "fix: bug with Arc and line tool #issue-#155".
+ Valid Tags are:
- fix
- feat
- build
- ci
- chore
- docs
- perf
- refactor
- revert
- style
- test
* Click the **Create Pull Request** button.
* Select **Linked Issues** in the right hand column and select the issue. Example: select issue #155.
* The maintainer will check that all CI/CD tests passed, review the code, then merge your issue branch into **develop**.
* At the next build, the PR Header description will be auto-added to the ChangeLog.md file.


Thanks for being an open source contributor!

0 comments on commit f4150ad

Please sign in to comment.