title: Append ticket number using git commit hooks?
body: <p>So my branch is named after bugtracker ticket number, something like "issue-1234", and we have a convention to always write down ticket number in commit message. I'm wondering if it's possible to append the ticket number in commit message automatically when I'm working on an issue-* branch without me explicitly typing it. </p>
  
  <p>I looked at git commit hooks, namely pre-commit, prepare-message, and post-commit, and none of them seem to be able to do what I wanted. Post-commit hook comes close, but you cannot modify the message that's committed with -m.</p>
  
  <p>To reiterate, I'm wondering if this is possible:</p>
  
  <p>On branch: issue-1234</p>
  
  <pre><code>git commit -a -m"fixed this pesky issue"
  </code></pre>
  
  <p>After the commit, in git log, it shows the message as:</p>
  
  <pre><code>fixed this pesky issue. ticket number: #1234
  </code></pre>