-
Notifications
You must be signed in to change notification settings - Fork 47
Development
Tiziano Müller edited this page Nov 5, 2018
·
11 revisions
We are using the Git Flow branching model with rebased feature branches and GitHub Pull Requests (PR).
This means:
-
develop
is our default & development branch. Developers can submit single, short commits directly here. - For larger changes, please use a
feature/...
branch (whether in your fork or on the DBCSR repo does not matter) and submit a PR for review. - Do a
git rebase develop
of your feature branch before submitting the Pull Request or merging. - Always do
git pull --rebase
to update your clone (or setup git to rebase by default by setting oncegit config --global pull.rebase true
) -
master
is the release branch. Every merge here constitutes a new release. - Split your commits into reasonable junks (use
git add -i
) and squash fixes in your feature branch before merging or submitting a PR (usegit rebase --interactive develop
) .
Links to Git Flow:
- Alternative description: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
- Python-based tools for Git: https://github.com/petervanderdoes/gitflow-avh
-
keep the summary (first line) short (usually <=50 characters), possibly include a tag. Examples:
travis: add required package lapack libcusmm: add parameters for new Turing card
-
use proper references to existing issues in the bug tracker or keywords to automatically close issues in your commit messages
- Release tagging happens on the
master
branch. - Therefore, directly after a release, add another merge from
develop
tomaster
to establish a relationship between tags and commits ondevelop
(thegit-flow
tools prefiously mentioned do that automatically when using thegit flow release ...
commands).
The following assumes that you are in an up-to-date clone of dbcsr
and that the remote pointing to https://github.com/cp2k/dbcsr is called upstream
.
$ git checkout -b release-X.Y.Z develop # create new temp branch based on develop
$ $EDITOR VERSION # update the version number
$ git commit -m "Bump version to X.Y.Z" VERSION
$ git checkout master
$ git merge --no-ff release-X.Y.Z # merge the release branch
$ git tag -a -m "Version X.Y.Z" vX.Y.Z
$ git checkout develop
$ git merge --no-ff master # merge the master into develop to ensure common ancestry
$ git push --atomic --follow-tags upstream master develop # push the two branches
$ git branch -d release-X.Y.Z
Using the git-flow tools, the process is a bit easier:
$ git flow release start X.Y.Z
$ $EDITOR VERSION # update the version number
$ git commit -m "Bump version to X.Y.Z" VERSION
$ git flow release finish X.Y.Z
$ git push --atomic --follow-tags upstream master develop # push the two branches
- GitHub does a release on https://github.com/cp2k/dbcsr/releases for each tag
- TravisCI is setup to build a complete tarball including all submodules for each tag and upload it as a draft
- After this is done, you have to update the release information for the release (update the changelog, etc.) and toggle the flag to mark is as a non-draft.