From: Junio C Hamano Date: Fri, 13 Jan 2006 17:40:24 GMT Subject: Re: git-commit: allow From: line to be entered in commit message Message-ID: <7v64oo9gc7.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <40b2b7d90601130311v78db741dx7c5eaa57ad300850@mail.gmail.com> Artem Khodush writes: >> $ export GIT_AUTHOR_NAME="$author" >> $ GIT_AUTHOR_EMAIL="$email" git commit -F .msgfile > >> Which is cumbersome and also ends up destroying your defaults if you happen >> to use that method, so afterward you have to unset them or reset them back >> to your own author info. > > I had a similar problem on cygwin. I agree that setting environment > variables by hand > is cumbersome, and modifying global environment is undesirable... Have you two known that more than one environment variables can be set for one-shot command execution? $ GIT_AUTHOR_NAME="$author" \ GIT_AUTHOR_EMAIL="$email" git commit -F .msgfile would give these environment variables for this "git commit" without affecting the later commands. Not that this really matters, since the above example was an excerpt of my suggestion about how to do this in a script, somehow made to look as if it was a suggestion about running things by hand from the command line...