Search code examples
gitgit-guigitk

git author date bogus as soon as amend or rebase took place


I observe a strange behavior in my git history:

I can commit as normal using git gui and author date and committer date are correctly when viewed in gitk.

But as soon as I perform an amend via git gui or an rebase via the git bash, all subsequent commits have the committer date correct and the author date being the same as the last commit before this rewrite process - sometimes several days in the past.

When I close git-gui, gitk and their parent git bash and reopen them, the date for the next commits is correct again - up until the next rebase/amend

git-gui version 0.20.GITGUI (Used under Windows)

git version 2.10.0.windows.1 (x64 bit)


Solution

  • Reason

    This is caused by a bug in Git Gui (in Git for Windows >=v2.8.2.windows.1) that sets the environment variables GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL and GIT_AUTHOR_DATE when you commit with ammend. These variables override all author-settings for any operation that creates commits, like rebase, commit, merge etc.

    Fix

    This should be fixed in the next version (v2.11.x ?) of G4W.

    Workaround

    Close Git Gui immediately after a commit with ammend.