re-write trac issue linking

fixes buggy output when the same issue is linked multiple times in commit message