tg-export.sh: make synthesized commits have unique timestamps
When creating new synthesized commits for --linearize or
--collapse, make sure they all have unique committer timestamps
that reflect the order in which they were synthesized.
Prior to this change, multiple commits could be synthesized
within the same second getting the same timestamp leading to
a subsequent ordering by git rev-list that depended on the
commit hash. This creates an undesirable unstable output.
Instead advance the committer timestamp by one second for
each new commit created also force GIT_AUTHOR_DATE to have
the same value if it would otherwise be unset or empty.
And also, while we're in there, avoid exporting GIT_AUTHOR_NAME
and GIT_AUTHOR_EMAIL unless they actually contain something.
If a previous commit caused them to be set and exported, it's not
enough to just set them to the empty string and not export them
again, they have to be explicitly unset to unexport them.
Signed-off-by: Kyle J. McKay <mackyle@gmail.com>