merge improvements to git parsing from 2.9.x to master

I know, we need to clean up our branches here. 

review by @jsuereth