Committing Changes to an Issue Branch - acquaman/acquaman GitHub Wiki

At reasonably logical intervals while working on an issue, team members should commit their changes into their local branch. This ensures that should a wrong turn be taken, the least amount of work as possible is lost. Committed changes should be given a reasonably descriptive list of the changes made, in order for future team members who may work on related issues (or continuing on with the same issue) have some idea of what the current state of the issue is, and the approach taken to resolve it.

How to Commit a Change to Your Local Branch

  • Firstly just double check you are on the branch you think you're on (easy to make a mistake when you're working on multiple issues at once): git branch
  • Make sure all the changes have been saved (running git status should give an overview of modified or added files within the branch, if necessary)
  • Within QtDesigner click Tools>>Git>>Commit...
  • Ensure the Author and Email information matches that of your github account
  • Check the files you wish to include in this commit in the Files section
  • Type in a descriptive commit message (see below)
  • Click the Commit button

Commit Message Guidelines

A few general tips for helping track changes make in a given git commit:

for new classes or functions added, the format:

Added:

  • new class ClassName added to perform function X
  • new function ClassName::functionName() added to perform function Y

for alterations, the format:

Altered:

  • removed call to ClassName1::functionName1() within ClassName2::functionName2() to stop ClassName2 doing Z

for removals, the format:

Removed:

  • removed class ClassName1 because it was replaced by class ClassName2
  • removed the function ClassName::functionName1() because it caused a performance issue in ClassName::functionName2()

Posting the Git Commit Message Back to the GitHub Issue Thread

It is advisable to keep other team members informed of changes by posting any commit messages back to the issue thread on GitHub each time a local commit is made. This allows relevant team members who wish to be consulted to be tagged in messages (by including @username in the message) or other issue threads to be references (by including #number in the message). It tends to be easier to do this at each incremental commit locally as it allows the team member to simply copy and paste the message from the Qt commit window into the GitHub post message box, though it is also possible to do this at merge time after testing by simply typing in git log and then inputting all the changes at once. Each change should be tagged with the commit hash which git generates for the commit, eg 83c359d28920c0d416786063ccd68f3460d3785e. This will automatically produce a hyperlink in the message which will take you to a page detailing the code changes in the commit (see 83c359d). Typing in git log will display a list of commits, with the relevant hash.