No reason to avoid git rev-parse HEAD.  I've amended the commit to use git rev-parse.