non-ascii chars in diff parse error, and some old fix from github/grit

If there is non-ascii chars in the filename, diff parse failed.
Especially when it is the first commit of the repo, I improved the regexps but wonder whether it is the best solution.