add @TAG_OFFSET@ support in versionformat for git

Mark the commit count since @PARENT_TAG@, if there
is no @PARENT_TAG@, will count since first commit.

Well, previous pull request was closed incorrect by me, so another one is here.
I found it just now, here is a broken issue for PARENT_TAG if we append suffix after it in versionformat, such as "@PARENT_TAG@.suffix". Remove the spare endlines in output of safe_run() will be fine. And I will split it as separate commit with test code.