From: sean Date: Fri, 13 Jan 2006 02:32:07 GMT Subject: Re: git-commit: allow From: line to be entered in commit message Message-ID: In-Reply-To: <7vzmm1mcfz.fsf@assigned-by-dhcp.cox.net> On Thu, 12 Jan 2006 12:13:52 -0800 Junio C Hamano wrote: > 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. Yes, obviously if there is another wrapper this isn't needed because that script could parse the From: line out of the text as well. > 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. This idea came up because recently on tLKML there was someone who asked Linus to pull from him that had all the author names as his own and a From: line in a bunch of the commit messages. When I sent him an email asking why he explained that it was just too cumbersome to bother setting up the proper author using git environment variables. Apparently he is more or less hand munging mutliple cvs branches into a nice git package for Linus to pull. He said that many of the patches don't apply as-is and need some manual tweaking before committing. > 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. Naw, I just don't think the date is as important or generally cared about as much, but you're right maybe that'd help someone too. > 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"). > Yeah, i wondered about that too. I think something like this patch, or as someone else suggested one that accepts the author on the command line, is needed. Having to set environment variables for this information just doesn't make much sense if you ever need to change it in a manual way, which is bound to happen from time to time. Cheers, Sean