Make the versioning to ignore non-version-like tags

Non-version-like tags include for example "jenkins-gpb-226".
Bugfix sometimes accidental new-line in comment

The date was printed with ~p instead of ~w,
In unfortunate cases and at unfortunate times,
for example if the preceeding git version and time string
was long, there could be a line break in the middle
of the date, causing parse errors.
Merge fixing of compilation on systems with non-GNU sed
Update ChangeLog for version 2.3