Write version data if either of commit hash or tag change.

setup.py did not update version after tagging,
because the commit hash did not change.