git-commit-post-finish-hook: Don't run until commit was created
When "emacsclient" returns, then that doesn't necessarily mean that "git commit", which used "emacsclient" as the `EDITOR', is already done creating the commit. We do not know the pid of "git commit", so we have to use some other method of finding out when committing is complete. We do so by looping until "HEAD" points at another commit than it did before the commit was initiated. Once that is the case we run the hook. If "HEAD" still points at the same commit after one second, then we give up and don't run the hook.
Showing with 22 additions and 6 deletions