magit/magit — pull request #387 by mbunkus (2012-03-07 12:47:46+00:00)
Title: Fix git author env

This branch includes two fixes that deal with the "Author:" field in commit buffers.

The first commit clears the environment variables `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL` and `GIT_AUTHOR_DATE` after the commit (they're set to the values they had before the commit -- and especially before the "Author:" field was parsed). Otherwise all subsequent commits will use the same values, even if no "Author:" field is found in the buffer. This is because environment variables are global to Emacs and not buffer or frame local.

For me this meant having to re-write roughly 60 commits due to wrong author information.

The second commit adds the "Author:" field to a commit buffer if the environment variable `GIT_AUTHOR_EMAIL` is set. This can happen in two cases: 1) It was set before Emacs has started. 2) It is set by magit and due to errors or bugs it stays set after a commit. This is more a reminder for the user so that he can act accordingly.