CRM-13872 - git-footnote - Improve behavior of "git commit --amend"

(Import code circa 5344afcc from git-footnote project)

----------------------------------------
* CRM-13872: git JIRA hook is not idempotent
  http://issues.civicrm.org/jira/browse/CRM-13872