From: Junio C Hamano Date: Thu, 12 Jan 2006 20:13:52 GMT Subject: Re: git-commit: allow From: line to be entered in commit message Message-ID: <7vzmm1mcfz.fsf@assigned-by-dhcp.cox.net> In-Reply-To: sean writes: > Mostly just for comment to see if there is any support > for this feature.... > > Sean > > --- > Use the author name and email information given as the > first line of the commit message in the form of: > > From: name > > as the author's name and email address in the resulting > commit object. This makes committing foreign patches > a little less cumbersome to handle for some workflows. Actually, I've considered this a couple of times in the past, but I ended up saying no. If the workflow is driving "git commit" from a script (i.e. your own Porcelain), the script can set GIT_AUTHOR_* environment variables, so this is a non issue. Which means that this 'From: ' thing is coming from the end user. Either you as the end user pasted it from some text file, or typed that line because you knew that the change was made by that person, not by you. If you pasted that line from somewhere else, I wonder what that "somewhere else" file is -- and what else that file contained. If the change came in an e-mail message, we already have tools for that (am/applymbox), and they do not lose the author-date information as your change to git-commit does, so I think it is a non issue. And I do not think of anything else that would have author name but does not have a patch text that you can feed git-apply with. Pasting from your address book just to save typing does not count as "pasting" --- that is still typing in this context. If you typed that line, why somebody else's change ended up in your working tree is a mystery to me, but let's say an office-mate edited things for you and said "this should work. test it out and if it is OK commit it for me." I have seen this kind of thing done in real life. If that is what happened, then what you are adding is a more convenient way than setting two GIT_AUTHOR_* environment variables. Maybe you forgot about preserving author date, in which case you would add 'Date: ' as well to your patch, and that would save your user from setting three environment variables. So the matter really is how much this patch is better than setting GIT_AUTHOR_* environment variables, unless it simplifies things for other programs (one possibility I have not looked into is that we _might_ be able to use "git commit" with this modification from "git am/applimbox/revert/cherry-pick").