I have a problem with the \'update\' hook. In the case of a new branch, it gets a 0000000000000000000000000000000000000000 as the \'oldrev\'. And I don\'t know how to handle
When $oldrev
is all zeros, a different git rev-list
command does all you need:
git rev-list $newrev --not --branches=*
will give you a list of revisions reachable from $newrev
but not from any branches.
Note that this definitely does not do the same thing as git rev-list $oldrev..$newrev
when oldrev is not all zeros, so you'll want to check which case you're in and pick the appropriate command to run.