*:Finally, if you are confident that this change should not be mentioned in the version history, a brief note explaining why. Is it entirely invisible to the user (internal cleanup)? Does it fix a bug that was never released? Finally, *remember to update the Version History!* VersionHistoryHowTo + +{subsection: 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: +{code} +git config --global commit.template ~/.gittemplate +{endcode} +Then, edit your =~/.gittemplate= file to look like the following: +{code} +The ticket is #xxxx +{endcode} +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=: + +{code} +#!/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 +} +{endcode} + +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=.