Branch detection improvements

Handle the case where the destination branch is not in the prepared message by querying "git branch". Handle rebasing commits by detecting "no branch" pointers.
Improve robustness of git log parsing