Page History

Turn Off History

A good commit message makes reviewing your changes later easier, and is especially helpful when the release wrangler is ensuring that the version history is complete.

A commit message should have:

Finally, remember to update the Version History! VersionHistoryHowTo

Git help for tickets

You may be absent-minded, and everyone occasionally forgets to put ticket numbers in their commit message. Git will actually help with this. You can run the following commands:

git config --global commit.template ~/.gittemplate
Then, edit your ~/.gittemplate file to look like the following:
The ticket is #xxxx
This template will be included in your commit message every time you run "git commit", and reminds you to write a ticket number.

Sometimes you will be in a hurry, and rush over the ticket number above. For this situation, you can install the following executable script at <path-to-CONDOR_SRC>/.git/hooks/commit-msg:

#!/bin/sh
#
# An example hook script to check the commit log message.
# Called by git-commit with one argument, the name of the file
# that has the commit message.  The hook should exit with non-zero
# status after issuing an appropriate message if it wants to stop the
# commit.  The hook is allowed to edit the commit message file.

/bin/grep -E -q '\#[0-9]+' "$1" || {
        echo
        echo
        echo "****** YOUR COMMIT WAS NOT ACCEPTED ******"
        echo "You need to assign a ticket number"
        echo
        echo
        exit 1
}

So now git will remind you loudly and refuse to commit if you forget to include a ticket number. If you are really sure that a ticket is not needed, you can override this with the command git commit --no-verify.