title: Git Post Commit Hook Getting Commit Number
body: <p>I am working on having my post-commit hook change a file to have the commit number, so that my application can use that in error handling.</p>
  
  <p>I was able to build the perl script to change the file, but I was wondering how to get the commit id from the hook.  Currently my hook looks like this:</p>
  
  <pre><code>#!/bin/sh
  #
  # An example hook script that is called after a successful
  # commit is made.
  #
  # To enable this hook, rename this file to "post-commit".
  
  #: Nothing
  perl -pi -e 's/[A-Za-z0-9+]$/commit-number/' ../../config/commit.git
  </code></pre>
  
  <p>I would like the commit-number to be some sort of variable holding the commit id.</p>
  
  <p>Edit: I figured out that <code>git rev-parse HEAD</code> will generate the HEAD commit which is what I need, but I don't know how to use that in the command.</p>