[log] improve diagnostics

Add previous refs
Add information about VCS
Fix commit count (it is multiplied by 5 just before reporting error)