Git branches

We maintain two branches in the Corinthia repository:

  • develop - This is the repository you should commit your work to in the general case. This can include work in progress features. Commits to this branch are not required to compile on all platforms or pass all tests, however if you're able to check before commit this is helpful for other developers.
  • stable - In order to commit to this branch, you *must* check that your code builds successfully on all supported platforms (currently Linux, Windows/VC++, OS X, and iOS).

After we move to Apache infrastructure, we will set up a build bot which checks into the stable branch automatically after verifying commits in develop compile on all platforms and pass all tests. From this point, developers will no longer commit directly to stable; instead always placing their commits in develop instead. This will provide an extra level of confidence in the stable branch. Ideally, the stable branch should be considered a continuous integration, and it should be possible at least at a technical level to cut a release from stable at any time.

Commit messages

Please follow these guidelines when writing commit messages:

http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

Leaving a tidy history

To make it easier for other developers to follow the progress of the code base, it's best to avoid pushing temporary "work in progress" commits where you're half-way through doing something that doesn't need to be shared immediately.

One way to do this is to normally do your work on a temporary branch, committing often, and then squashing all those commits into the develop branch once you have the code in a state where it's ready to go in the main repository.

To create a temporary branch and work on it, do the following:

git checkout -b work

  ... Make some changes...

git commit -am "Work"

  ... Make some more changes...

git commit -am "Work"

Tidy up code, ensure all tests pass

git commit -am "Work"

Once you're done, squash all those changes into a single commit on the develop branch, and delete the temporary branch:

git checkout master
git merge --squash work
git commit -a

Type in a detailed commit message, with summary + detail

git branch -D work
git push



  • No labels