Recently, I have used Trac to manage a git project, and I used a git post-receive hook to sync the commit back to Trac.
The hook starts with something like this:
read oldrev newrev refname REV=$(git rev-list "$oldrev..$newrev")
/usr/local/bin/trac-admin /app/trac/trac_env changeset added $git_name $REV
It works fine for most cases, however, when I try to push a new branch to remote, the $oldrev becomes 0, and caused problem.
fatal: ambiguous argument '0..70e0844': unknown revision or path not in the working tree.