XP-Dev.com Documentation

Smart Commit Messages

To be able to link commits in your source control with various artifacts, both the artifact and repository need to be in the same project

Linking Commits with Artifacts

To link a commit change with an artifact, all you have to do is add the #<id> of the artifact in your commit message. The #<id> number of the artifact can be found in various places.

For example, to link your change to task #3, all that is needed is to add #3 to your commit message.

The commit change should be displayed under the Commits tab of your story or bug.

Performing Actions on Artifacts using Commit Messages

There are two actions that are supported:

  • Closing artifacts
    To close an artifact, you need to specify the phrase #<id> somewhere in your commit message.
    Examples: Move image to footer. Closes #29 or Fixed #40 - add a synchronised block
  • Adding hours to artifacts
    To add hours to an artifact, you need to specify the phrase #<id> add <hours>h
    Examples: Managed to get the form working again, #21 add 1.5h

You can combine the two above to close and add hours to artifacts simultaneously.
Examples: Use red for the background. Closes #49 add 0.3h will close artifact #49 and add 0.3 hours to it.

Advanced Usage and Hints

  • To link a change to a number of artifacts, just repeat the #<id> of the affected artifacts in the same commit message. For example, did some changes to #45 #22 #99 will add the commit message to artifacts #45, #22 and #99.
  • You can close a number of artifacts by repeating the #<id> of the artifacts in a row. For example, Closes #45 #22 #99 will close artifacts #45, #22 and #99.

Git Repositories

You need to tell Git to use your XP-Dev.com username:

$ cd /path/to/repository
$ git config user.name "my.xp-dev.com.username"

Or to specify it globally:

$ git config --global user.name "my.xp-dev.com.username"

Mercurial Repositories

You need to tell Mercurial to use your XP-Dev.com username.

To do this, edit your hgrc file and specify under the ui section:

username = xp-dev.com.username

For e.g. if your XP-Dev.com is bobthedeveloper then you should specify:

username = bobthedeveloper

Trac Projects

To be able to use smart commit messages on Trac projects, you will need to either use the Timing and Estimation or Agilo plugin

Timing and Estimation Plugin

The following comments will work to reference tickets and add hours:

  • Blah refs #12 (1) will add 1h to the spent time for issue #12 Blah refs #12 (spent 1.5) will add 1.5h to the spent time for issue #12

Agilo Plugin

The following comment will work to reference tickets and change remaining hours:

This closes #34 and #35 and remaining #5:4h. See #43 for more details.

This will perform the following:

  • Closes the ticket #34 and #35, Agilo will check the following to allow to close the tickets:
  • That the tickets have been accepted
  • That the owner of the ticket is the same as the committer
  • Set the remaining time of ticket #5 to 4h, checking that the owner of the ticket is the same as the committer
  • Add a reference to the ticket #43 that will be marked also in the destination ticket, linking it to the current committed changeset.

Feel free to contact us if you need any assistance.