{"thread":{"id":"11592","subject":"[PATCH] Add committer and author names to top of COMMIT_EDITMSG.","startedAt":"2008-01-11T20:10:53Z","lastAt":"2008-01-12T08:02:38Z","messageCount":17,"participants":["Stephen Sinclair","Johannes Schindelin","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"65055","messageId":"9b3e2dc20801111210n7bd7a71cw437819aa6253ae85@mail.gmail.com","threadId":"11592","inReplyTo":null,"subject":"[PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-11T20:10:53Z","receivedAt":"2008-01-11T20:10:53Z","isPatch":true,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":"Add committer and author names to top of COMMIT_EDITMSG.\n\nSigned-off-by: Stephen Sinclair <radarsat1@gmail.com>\n---\n builtin-commit.c |   12 +++++++++++-\n 1 files changed, 11 insertions(+), 1 deletions(-)\n\ndiff --git a/builtin-commit.c b/builtin-commit.c\nindex 73f1e35..4fd9367 100644\n--- a/builtin-commit.c\n+++ b/builtin-commit.c\n@@ -423,8 +423,18 @@ static int prepare_log_message(const char\n*index_file, const char *prefix)\n \t\t\t\"#\\n\",\n \t\t\tgit_path(\"MERGE_HEAD\"));\n\n+    fprintf(fp, \"\\n\");\n+\n+    fprintf(fp,\n+            \"# Committer: %s\\n\"\n+            \"# Author:    %s\\n\"\n+            \"#\\n\",\n+            fmt_name(getenv(\"GIT_AUTHOR_NAME\"),\n+                     getenv(\"GIT_AUTHOR_EMAIL\")),\n+            fmt_name(getenv(\"GIT_COMMITTER_NAME\"),\n+                     getenv(\"GIT_COMMITTER_EMAIL\")));\n+\n \tfprintf(fp,\n-\t\t\"\\n\"\n \t\t\"# Please enter the commit message for your changes.\\n\"\n \t\t\"# (Comment lines starting with '#' will \");\n \tif (cleanup_mode == CLEANUP_ALL)\n-- \n1.5.4.rc2.85.ga7943-dirty\n"},{"id":"65067","messageId":"alpine.LSU.1.00.0801112124520.31053@racer.site","threadId":"11592","inReplyTo":"9b3e2dc20801111210n7bd7a71cw437819aa6253ae85@mail.gmail.com","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-01-11T21:26:47Z","receivedAt":"2008-01-11T21:26:47Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 11 Jan 2008, Stephen Sinclair wrote:\n\n> Add committer and author names to top of COMMIT_EDITMSG.\n\nThis commit message is severely lacking: it is just a repetition of the \ncommit subject, it is too technical (what is COMMIT_EDITMSG for, \nanyway?), and even worse, it does not begin to explain _why_ this is a \ngood change.\n\nCiao,\nDscho\n"},{"id":"65081","messageId":"7v3at42avd.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"9b3e2dc20801111210n7bd7a71cw437819aa6253ae85@mail.gmail.com","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-11T23:36:22Z","receivedAt":"2008-01-11T23:36:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stephen Sinclair\" <radarsat1@gmail.com> writes:\n\n> @@ -423,8 +423,18 @@ static int prepare_log_message(const char\n> *index_file, const char *prefix)\n>  \t\t\t\"#\\n\",\n>  \t\t\tgit_path(\"MERGE_HEAD\"));\n>\n> +    fprintf(fp, \"\\n\");\n> +\n> +    fprintf(fp,\n> +            \"# Committer: %s\\n\"\n> +            \"# Author:    %s\\n\"\n> +            \"#\\n\",\n> +            fmt_name(getenv(\"GIT_AUTHOR_NAME\"),\n> +                     getenv(\"GIT_AUTHOR_EMAIL\")),\n> +            fmt_name(getenv(\"GIT_COMMITTER_NAME\"),\n> +                     getenv(\"GIT_COMMITTER_EMAIL\")));\n> +\n\nI'd almost agree with this patch if if added AUTHOR but not\nCOMMITTER, and only when AUTHOR is different from me.  That\nwould help reassure anybody while amending other's changes.\nCOMMITTER is always me and I should not reminded with extra\nlines that waste precious screen real estate.\n\nAnd no, I did not check if your change correctly supports the\nuse case of amending other's changes.  But if I recall the code\ncorrectly, I suspect that your change doesn't.  The recorded\nauthor is determined after the log message is prepared, way\nlater.\n\nI strongly agree with Dscho that this change needs to be\ndefended with a good description on the reason why this is good.\nIf the reason is \"newbie protection\", I do not think this is a\ngood change at all.  Newbie protection is never a good reason to\nmake people who graduated that state to pay extra price\nunconditionally.\n"},{"id":"65088","messageId":"9b3e2dc20801111609t3103af1frc23519cab43ae8be@mail.gmail.com","threadId":"11592","inReplyTo":"7v3at42avd.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-12T00:09:23Z","receivedAt":"2008-01-12T00:09:23Z","isPatch":true,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":"> I'd almost agree with this patch if if added AUTHOR but not\n> COMMITTER, and only when AUTHOR is different from me.  That\n> would help reassure anybody while amending other's changes.\n> COMMITTER is always me and I should not reminded with extra\n> lines that waste precious screen real estate.\n\nThe purpose of my patch was to remind _myself_ what my name is, in\ncase I hadn't configured it correctly.\nBut I can see this use case also being useful.\n\n\n> And no, I did not check if your change correctly supports the\n> use case of amending other's changes.  But if I recall the code\n> correctly, I suspect that your change doesn't.  The recorded\n> author is determined after the log message is prepared, way\n> later.\n\nSure, that's possible.\n\n\n> I strongly agree with Dscho that this change needs to be\n> defended with a good description on the reason why this is good.\n\nThe patch was really to go along with my RFC about the idea.  I guess\nit was too early to post a possible implementation.\n(I have only just begun to look at the git code after all..)\n\n\n> If the reason is \"newbie protection\", I do not think this is a\n> good change at all.  Newbie protection is never a good reason to\n> make people who graduated that state to pay extra price\n> unconditionally.\n\nI agree.  I wouldn't necessarily say it is \"newbie protection\", so\nmuch as a friendly reminder of what username you are using while doing\na commit, which, as I said, might not be as expected if you have just\nsat down at a new machine.  Especially if you have been using git for\na long time on a single machine, it is something you might easily\nforget to configure.  (As I have, several times now.)  I agree,\nhowever, that this it is not necessarily worth having this on the\nscreen every time you do a commit, for the exceptional instance where\nit might be wrong.  Perhaps more usefully it could appear only if you\nhaven't yet created a user.email and user.name config entry.\n\nActually in my honest opinion, the default of using the computer's\nhost name and login is pretty much _never_ right, but I thought this\npatch might be less intrusive than introducing a new error message.\n\nI do have a slightly better patch now that has a more informative\nmessage and uses git_committer_info() and git_author_info(), however\nI'll wait for any more opinions before posting it.\n\nIn retrospect, I guess I could just as easily solve my problem by\nintroducing a post-receive hook for my personal repo that issues a\nwarning for commits not configured to my email address.\n\n\nSteve\n"},{"id":"65091","messageId":"7vbq7r28qo.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"9b3e2dc20801111609t3103af1frc23519cab43ae8be@mail.gmail.com","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T00:22:23Z","receivedAt":"2008-01-12T00:22:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stephen Sinclair\" <radarsat1@gmail.com> writes:\n\n>> I'd almost agree with this patch if if added AUTHOR but not\n>> COMMITTER, and only when AUTHOR is different from me.  That\n>> would help reassure anybody while amending other's changes.\n>> COMMITTER is always me and I should not reminded with extra\n>> lines that waste precious screen real estate.\n>\n> The purpose of my patch was to remind _myself_ what my name is, in\n> case I hadn't configured it correctly.\n\nIn that case, I would imagine a rule like this would be more\nappropriate than unconditionally showing AUTHOR/COMMITTER in all\ncases:\n\n * If AUTHOR_NAME+EMAIL is different from AUTHOR_NAME+EMAIL that\n   I would normally get for myself, or\n\n * If AUTHOR_NAME+EMAIL contains garbage identifier commonly\n   found when misconfigured (e.g. \".(none)\" at the end of\n   e-mail),\n\nthen show AUTHOR.  In addition, if it is the latter case, give\nhints to configure before casting the mistake in stone.\n"},{"id":"65104","messageId":"9b3e2dc20801111733o477b3aadv6ee76d3aafade54a@mail.gmail.com","threadId":"11592","inReplyTo":"7vbq7r28qo.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-12T01:33:23Z","receivedAt":"2008-01-12T01:33:23Z","isPatch":true,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":">  * If AUTHOR_NAME+EMAIL is different from AUTHOR_NAME+EMAIL that\n>    I would normally get for myself, or\n\nI thought of this, however if the purpose of this is to handle a case\nwhere you do a commit from a new and unconfigured user account, \"that\nI would normally get for myself\" is undefined, since this information\nis (rightfully) not propagated by git-clone.  This is why I made it\nunconditional, (or perhaps something you could could turn off, but\nwould by default be on), but I figured there would be objections since\nI admit it's not always useful information.\n\n>  * If AUTHOR_NAME+EMAIL contains garbage identifier commonly\n>    found when misconfigured (e.g. \".(none)\" at the end of\n>    e-mail),\n\nThat's more interesting to me.  I just checked my logs and I do see\nthat in at least one case, this .(none) was not appended.  The\ncomputer in question was configured (not by me) with a domain of\n\".local\", so the commit has <machinename>.local as part of the email\naddress.  However I would imagine this might solve most cases.\n\nI still don't understand why git generates a default email address\ninstead of just giving an error message; do people actually use this\nscenario?  In my experience an email address must always be explicitly\ngiven, but perhaps some people work on the machines that also receive\ntheir mail.  I rarely do \"real\" work on an actual server, but I guess\nsome people do.  I think they must be in the minority though..\n\nOn the other hand, now that I've been thinking about it I think my\nidea of simply configuring a hook in my personal central git is\nprobably an easier and all-round better solution to my problem.  I\nunderstand that git relies on system accounts for security, but\nthere's no reason I can't configure a particular repo to issue a\nwarning when it receives incoming commits from an unknown user/email.\n\n\nSteve\n"},{"id":"65108","messageId":"7vejcnzu5z.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"9b3e2dc20801111733o477b3aadv6ee76d3aafade54a@mail.gmail.com","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T01:53:12Z","receivedAt":"2008-01-12T01:53:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stephen Sinclair\" <radarsat1@gmail.com> writes:\n\n>>  * If AUTHOR_NAME+EMAIL is different from AUTHOR_NAME+EMAIL that\n>>    I would normally get for myself, or\n>\n> I thought of this, however if the purpose of this is to handle a case\n> where you do a commit from a new and unconfigured user account, \"that\n> I would normally get for myself\" is undefined, since this information\n> is (rightfully) not propagated by git-clone.  This is why I made it\n> unconditional, (or perhaps something you could could turn off, but\n> would by default be on), but I figured there would be objections since\n> I admit it's not always useful information.\n\nWhat are you talking about?\n\nIn a properly configured repository, telling you who git thinks\nyou are is _ALWAYS_ useless (that's the definition of \"properly\nconfigured\").  Just admit it.\n\nThe only case it is of any use is to remind people who amend\nother people's change.  Showing the AUTHOR for the commit being\ncreated would add value (and the knowledge that git shows AUTHOR\nin that situation would help remind you that it will be\nrecording your own name if you do not see that line).\n\n>>  * If AUTHOR_NAME+EMAIL contains garbage identifier commonly\n>>    found when misconfigured (e.g. \".(none)\" at the end of\n>>    e-mail),\n>\n> That's more interesting to me.  I just checked my logs and I do see\n> that in at least one case, this .(none) was not appended.  The\n> computer in question was configured (not by me) with a domain of\n> \".local\", so the commit has <machinename>.local as part of the email\n> address.  However I would imagine this might solve most cases.\n\nYes, and please notice that \"e.g.\" in my description means \"I am\njust giving you an example, not the exhaustive list for the\nfinal solution but a hint to one possibly acceptable solution\".\n\".local\", \"@localhost\", \"@<distroname>\" and \".(none)\" are all\nplausible red-flag raisers.  There may be more, but I think we\nshould be able to catch most misconfigurations with simple\nrules.\n\n> I still don't understand why git generates a default email address\n> instead of just giving an error message; do people actually use this\n> scenario?\n\nThe official party line to defend the existing behaviour is that\nthere is no need to configure anything, when the host and gecos\nis done properly.  But I tend to agree with you that quite a lot\nof systems are not \"done properly\", and users cannot do much\nabout it in some cases.  I think most of misconfigured systems\nare personal boxes they have control over but not all.\n\nPerhaps we could disable the code that reads from hostname and\ngecos, and instead always force the users to configure.  But\nthat kind of change is not something I'd want to be discussing\nright now.\n"},{"id":"65112","messageId":"9b3e2dc20801111825i644da598i7556ef700b870445@mail.gmail.com","threadId":"11592","inReplyTo":"7vejcnzu5z.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-12T02:25:16Z","receivedAt":"2008-01-12T02:25:16Z","isPatch":true,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":"> In a properly configured repository, telling you who git thinks\n> you are is _ALWAYS_ useless (that's the definition of \"properly\n> configured\").  Just admit it.\n\nWell, I'll admit that I don't really understand you here.\nMaybe I'm still too much of a git newbie on this.  (Fair enough.)\nRight now the only way to make sure I'm committing as myself with my\nproper email address is to:\n\n--  remember to \"git-config --list\", and check that my email is listed.\n--  \"git-commit; git-log\", and remember to check the last entry before\ndoing a \"git-push\".\n\nAm I missing something?\n\nIf proper use of git seems to require remembering one of these two\nthings, that's okay with me, I'll just do my best, but it was an area\nwhere I thought I might suggest an improvement.  (As a rule, I prefer\nletting the computer remember things for me.)\n\n\n> \".local\", \"@localhost\", \"@<distroname>\" and \".(none)\" are all\n> plausible red-flag raisers.  There may be more, but I think we\n> should be able to catch most misconfigurations with simple\n> rules.\n\nI'd have to disagree with you here.  Most people name their boxes one\nthing or another, and trying to catch it with some rule is pointless.\nEspecially considering the default name is taken from the hostname\nanyway -- you're taking the local hostname and then checking with a\nrule to see if it might be localhost.  Personally I think the solution\nis not to take the hostname in the first place, since in my experience\nit's rarely equivalent to a valid email address.\n\nObviously though my personal experience is apparently not the same as\nthat of others'.  I do most of my development on personal boxes, or\nlaptops configured by some non-professional guy in my lab at\nuniversity.  Or on virtual machines, which was my recent case.\n\n\n> Perhaps we could disable the code that reads from hostname and\n> gecos, and instead always force the users to configure.\n\nThat would be my preference, and I do think there's a case for it. But\nwhether it's a strong one or not I'm not sure.\n\n> But that kind of change is not something I'd want to be\n> discussing right now.\n\nThat's okay.  In the spirit of git, I'll just solve my problem in my\nown branch.. ;-)\n\nthanks for the comments,\nSteve\n"},{"id":"65119","messageId":"20080112045231.GB5211@coredump.intra.peff.net","threadId":"11592","inReplyTo":"7vejcnzu5z.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-12T04:52:31Z","receivedAt":"2008-01-12T04:52:31Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jan 11, 2008 at 05:53:12PM -0800, Junio C Hamano wrote:\n\n> The official party line to defend the existing behaviour is that\n> there is no need to configure anything, when the host and gecos\n> is done properly.  But I tend to agree with you that quite a lot\n> of systems are not \"done properly\", and users cannot do much\n> about it in some cases.  I think most of misconfigured systems\n> are personal boxes they have control over but not all.\n\nI think there are plenty of reasons for the host/gecos information not\nbeing useful. Is a workstation whose hostname is not a valid mailing\naddress really not \"done properly\"?\n\n> Perhaps we could disable the code that reads from hostname and\n> gecos, and instead always force the users to configure.  But\n> that kind of change is not something I'd want to be discussing\n> right now.\n\nThis is obviously not 1.5.4 material, so I haven't given it that much\nthought either. But perhaps Stephen's \"author message\" should simply\ntrigger any time the author is pulled from gecos? I suppose that would\nannoy people who use this feature all the time, but they can silence the\n\"warning\" with a simple git-config.\n\n-Peff\n"},{"id":"65121","messageId":"7vve5zy72p.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"9b3e2dc20801111825i644da598i7556ef700b870445@mail.gmail.com","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T04:57:18Z","receivedAt":"2008-01-12T04:57:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stephen Sinclair\" <radarsat1@gmail.com> writes:\n\n>> In a properly configured repository, telling you who git thinks\n>> you are is _ALWAYS_ useless (that's the definition of \"properly\n>> configured\").  Just admit it.\n>\n> Well, I'll admit that I don't really understand you here.\n> Maybe I'm still too much of a git newbie on this.  (Fair enough.)\n> Right now the only way to make sure I'm committing as myself with my\n> proper email address is to:\n>\n> --  remember to \"git-config --list\", and check that my email is listed.\n> --  \"git-commit; git-log\", and remember to check the last entry before\n> doing a \"git-push\".\n>\n> Am I missing something?\n\nThey are both valid means to make sure you did not misconfigure.\n\nYou omitted the part that matters from the part you quoted\nabove, but this discussion was about \"showing AUTHOR if it is\ndifferent from me\", which was _one of_ the two conditions I\nsuggested in my counterproposal, and I was saying that it is\nuseless to expect that you would be able to find a\nmisconfiguration when AUTHOR is shown for this first reason.\nThis part is _not_ about catching your misconfiguration.\n\nThe other part is about the misconfiguration catching.\n\n> Especially considering the default name is taken from the hostname\n> anyway -- you're taking the local hostname and then checking with a\n> rule to see if it might be localhost.\n\nYes, and earlier you said one of the undesirable ones was\n\"yourname@foo.local\" (and others were \"yourname@foo.(none)\").\nIOW, \"localhost\" is one of the things you want to catch as\nunconfigured bogosity that you want to catch, isn't it?\n\nAnd that is _the other_ condition in my counterproposal to show\nAUTHOR.\n\nTo rephrase, you would show AUTHOR when one of the conditions\nholds true, either:\n\n (1) \"not me\" (so that we can remind that other's commit is\n     being amended); _OR_ \n\n (2) \"funny me\" (so that we can catch misconfiguration.\n\n\nThe latter would not have to trigger once you configure your\n~/.gitconfig (or .git/config) properly.\n"},{"id":"65124","messageId":"7vprw7y6mz.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"20080112045231.GB5211@coredump.intra.peff.net","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T05:06:44Z","receivedAt":"2008-01-12T05:06:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> This is obviously not 1.5.4 material, so I haven't given it that much\n> thought either. But perhaps Stephen's \"author message\" should simply\n> trigger any time the author is pulled from gecos? I suppose that would\n> annoy people who use this feature all the time, but they can silence the\n> \"warning\" with a simple git-config.\n\nWell, we could certainly do that.\n\nBut I am not entirely happy with the idea of having to make the\ndefault silly and inconvenient, only because otherwise new\npeople who did not even bother to read and follow the VERY FIRST\nsubsection of the tutorial that tells them that the first thing\nto do is to use user.name and user.email would not notice their\nproblems, and experts know enough to squelch that broken\ndefault.  Middle level people (and newbies will quickly become\none of them) will be inconvenienced even though they followed\nthe tutorial's instruction, until they find the configuration\nvariable to turn that silly AUTHOR output off.\n"},{"id":"65125","messageId":"7vlk6vy5jj.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"7vprw7y6mz.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T05:30:24Z","receivedAt":"2008-01-12T05:30:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Jeff King <peff@peff.net> writes:\n>\n>> This is obviously not 1.5.4 material, so I haven't given it that much\n>> thought either. But perhaps Stephen's \"author message\" should simply\n>> trigger any time the author is pulled from gecos?\n\nI think what we could do if we wanted to protect people from\nunconfigured identity is to stop pulling names from gecos and\nhostname, and respect _only_ environment and config.\n\nAnd fail any operation that we would want configured name and\nemail (names in reflog does not count as such an operation ---\nwe've made that mistake once, which made \"git clone\" impossible\nbefore setting up $HOME/.gitconfig).\n\nThat I think I can live with.\n\nIf we do that, we do not have to see two extra lines (COMMITTER\nand AUTHOR) that spells our own name in the commit message\nbuffer, which almost always will be a total waste of space.\n"},{"id":"65126","messageId":"20080112053225.GA6059@coredump.intra.peff.net","threadId":"11592","inReplyTo":"7vlk6vy5jj.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-12T05:32:25Z","receivedAt":"2008-01-12T05:32:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jan 11, 2008 at 09:30:24PM -0800, Junio C Hamano wrote:\n\n> I think what we could do if we wanted to protect people from\n> unconfigured identity is to stop pulling names from gecos and\n> hostname, and respect _only_ environment and config.\n\nI am fine with that, as I have always set up the configuration manually\nanyway. But I think it would need a significant comment period from the\nlist (ISTR that Linus _likes_ pulling the hostname from gecos).\n\n-Peff\n"},{"id":"65132","messageId":"7vhchjy4cg.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"20080112053225.GA6059@coredump.intra.peff.net","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T05:56:15Z","receivedAt":"2008-01-12T05:56:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Fri, Jan 11, 2008 at 09:30:24PM -0800, Junio C Hamano wrote:\n>\n>> I think what we could do if we wanted to protect people from\n>> unconfigured identity is to stop pulling names from gecos and\n>> hostname, and respect _only_ environment and config.\n>\n> I am fine with that, as I have always set up the configuration manually\n> anyway. But I think it would need a significant comment period from the\n> list (ISTR that Linus _likes_ pulling the hostname from gecos).\n\nYou do not pull hostname from gecos, but I agree with your main\npoint.\n"},{"id":"65133","messageId":"20080112055802.GA6117@coredump.intra.peff.net","threadId":"11592","inReplyTo":"7vhchjy4cg.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-01-12T05:58:02Z","receivedAt":"2008-01-12T05:58:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Jan 11, 2008 at 09:56:15PM -0800, Junio C Hamano wrote:\n\n> > list (ISTR that Linus _likes_ pulling the hostname from gecos).\n> \n> You do not pull hostname from gecos, but I agree with your main\n> point.\n\nHeh. Sorry, the sentence made more sense before I edited it.\n\n-Peff\n"},{"id":"65141","messageId":"9b3e2dc20801112326p2b4eaf96tbd036ed746eff4a3@mail.gmail.com","threadId":"11592","inReplyTo":"7vve5zy72p.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Stephen Sinclair","fromEmail":"radarsat1@gmail.com","sentAt":"2008-01-12T07:26:24Z","receivedAt":"2008-01-12T07:26:24Z","isPatch":true,"sender":{"key":"radarsat1@gmail.com","avatar":null},"body":"> You omitted the part that matters from the part you quoted\n> above, but this discussion was about \"showing AUTHOR if it is\n> different from me\", which was _one of_ the two conditions I\n> suggested in my counterproposal, and I was saying that it is\n> useless to expect that you would be able to find a\n> misconfiguration when AUTHOR is shown for this first reason.\n> This part is _not_ about catching your misconfiguration.\n>\n> The other part is about the misconfiguration catching.\n\nOkay, sorry I guess I was misreading it because that wasn't really my\noriginal intention with the patch.  However in that context I can see\nthat showing author information when it differs from yourself could\ndefinitely be useful.\n\n\n> Yes, and earlier you said one of the undesirable ones was\n> \"yourname@foo.local\" (and others were \"yourname@foo.(none)\").\n> IOW, \"localhost\" is one of the things you want to catch as\n> unconfigured bogosity that you want to catch, isn't it?\n\nWell, it was only an example to show that it's easily possible (in\nfact, common) to have hostnames that are not configured as actual\nemail domains.  The fact that the hostname contained the word \"local\"\nwas an indication, but I'm not really sure that filtering for that\nword in the hostname would be such a good idea.  I'm also not sure how\nmany admins will even end up sticking \".local\" as their domain, it's\nprobably just a quirk of the administrator for my lab.\n\nI guess \"localhost\" really clearly is a \"bogus\" host name, but other\nthan that I can't think of any real rules that would make sense.\nRather, IMHO, the error is earlier in the chain: doing anything with\nthe hostname in the first place.\n\n\n> To rephrase, you would show AUTHOR when one of the conditions\n> holds true, either:\n>\n>  (1) \"not me\" (so that we can remind that other's commit is\n>      being amended); _OR_\n>\n>  (2) \"funny me\" (so that we can catch misconfiguration.\n\nI definitely agree with (1), though having not really done much\namending of other people's commits I can't vouch for it.  I think (2)\nmight not be very reliable.\n\n\nSince submitting the patch, I have added a post-receive hook to my\nrepo which checks all incoming commits and verifies whether any names\nor email addresses are not in a whitelist.  If any are flagged, a\nwarning is displayed.  This is actually quite satisfactory for me,\nsince it'll warn me when I accidentally push commits with the wrong\nname to my private repo, but before I push to public.  Let me know if\nsomething like this would be useful for the contrib folder..\n\nSteve\n"},{"id":"65153","messageId":"7vve5zv5cx.fsf@gitster.siamese.dyndns.org","threadId":"11592","inReplyTo":"9b3e2dc20801112326p2b4eaf96tbd036ed746eff4a3@mail.gmail.com","subject":"Re: [PATCH] Add committer and author names to top of COMMIT_EDITMSG.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-01-12T08:02:38Z","receivedAt":"2008-01-12T08:02:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Stephen Sinclair\" <radarsat1@gmail.com> writes:\n\n>> To rephrase, you would show AUTHOR when one of the conditions\n>> holds true, either:\n>>\n>>  (1) \"not me\" (so that we can remind that other's commit is\n>>      being amended); _OR_\n>>\n>>  (2) \"funny me\" (so that we can catch misconfiguration.\n>\n> I definitely agree with (1), though having not really done much\n> amending of other people's commits I can't vouch for it.  I think (2)\n> might not be very reliable.\n\nYeah, I tend to agree that (2) is probably impossible to\nachieve.\n\nAuthor ident should be reachable e-mail address but some people\nseem to prefer committer ident to be tied to the actual machine\neven if that makes the ident something that merely resembles a\nvalid reachable e-mail address but in fact unreachable.  For\nsuch a committer ident, taking it from hostname would be a\nreasonable thing to do, but I suspect that is a minority.\n\nUnfortunately we do not have an easy way (other than using\nGIT_COMMITTER_EMAIL environment) to define different author and\ncommitter idents.\n"}]}