{"thread":{"id":"43177","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","startedAt":"2006-11-28T10:27:39Z","lastAt":"2006-11-29T09:29:36Z","messageCount":11,"participants":["Andy Parkins","Jakub Narebski","Johannes Schindelin","Han-Wen Nienhuys","Junio C Hamano","Shawn Pearce"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"296612","messageId":"ekh2uh$nk2$1@sea.gmane.org","threadId":"43177","inReplyTo":null,"subject":"[PATCH] Trim hint printed when gecos is empty.","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-28T10:27:39Z","receivedAt":"2006-11-28T10:27:39Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"\nTrim hint printed when gecos is empty.\nRemove asterisks for readability\nSuggest use of git-config for easy cut & pasting.\n---\n ident.c |   15 ++++++++++-----\n 1 files changed, 10 insertions(+), 5 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex efec97f..e415fd3 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -158,12 +158,17 @@ static int copy(char *buf, int size, int\n static const char au_env[] = \"GIT_AUTHOR_NAME\";\n static const char co_env[] = \"GIT_COMMITTER_NAME\";\n static const char *env_hint =\n-\"\\n*** Environment problem:\\n\"\n+\"\\n\"\n \"*** Your name cannot be determined from your system services (gecos).\\n\"\n-\"*** You would need to set %s and %s\\n\"\n-\"*** environment variables; otherwise you won't be able to perform\\n\"\n-\"*** certain operations because of \\\"empty ident\\\" errors.\\n\"\n-\"*** Alternatively, you can use user.name configuration variable.\\n\\n\";\n+\"\\n\"\n+\"Run\\n\"\n+\"\\n\"\n+\"  git repo-config user.email \\\"you@email.com\\\"\\n\"\n+\"  git repo-config user.name \\\"Your Name\\\"\\n\"\n+\"\\n\"\n+\"To set the identity in this repository.\\n\"\n+\"Add --global to set your account\\'s default\\n\"\n+\"\\n\";\n \n static const char *get_ident(const char *name, const char *email,\n \t\t\t     const char *date_str, int error_on_no_name)\n-- \n1.4.2.4\n\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"296197","messageId":"ekh4cu$q6e$2@sea.gmane.org","threadId":"43177","inReplyTo":"ekh2uh$nk2$1@sea.gmane.org","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@xs4all.nl","sentAt":"2006-11-28T10:52:24Z","receivedAt":"2006-11-28T10:52:24Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Han-Wen Nienhuys escreveu:\n> Trim hint printed when gecos is empty.\n> Remove asterisks for readability\n> Suggest use of git-config for easy cut & pasting.\n> ---\n\nand \n\nSigned-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>\n\nis there a reason why git-format-patch doesn't add a sign-off by default?\n\n\n-- \n Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen\n"},{"id":"294460","messageId":"ekh5k8$vih$1@sea.gmane.org","threadId":"43177","inReplyTo":"ekh4cu$q6e$2@sea.gmane.org","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-11-28T11:15:00Z","receivedAt":"2006-11-28T11:15:00Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Han-Wen Nienhuys wrote:\n\n> Han-Wen Nienhuys escreveu:\n>> Trim hint printed when gecos is empty.\n>> Remove asterisks for readability\n>> Suggest use of git-config for easy cut & pasting.\n>> ---\n> \n> and \n> \n> Signed-off-by: Han-Wen Nienhuys <hanwen@xs4all.nl>\n> \n> is there a reason why git-format-patch doesn't add a sign-off by default?\n\nYes. You are supposed to add Signed-off-by on commit (I hope that\ngit-format-patch doesn't dulicate signoff lines), using git-commit -s.\n\nBut perhaps a config option...\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n\n"},{"id":"294562","messageId":"200611281146.56201.andyparkins@gmail.com","threadId":"43177","inReplyTo":"ekh5k8$vih$1@sea.gmane.org","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-28T11:46:54Z","receivedAt":"2006-11-28T11:46:54Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2006 November 28 11:15, Jakub Narebski wrote:\n\n> Yes. You are supposed to add Signed-off-by on commit (I hope that\n> git-format-patch doesn't dulicate signoff lines), using git-commit -s.\n\n> But perhaps a config option...\n\nI achieve reasonable results by having the following in my .git/config\n\n[format]                                                                                                                                                              \n    headers = \"To: git@vger.kernel.org\\n\"                                                                                                                             \n                                                                                                                                                                      \n[alias]                                                                                                                                                               \n    email=format-patch --signoff --stdout                                                                                                                             \n\nBy tuning this per-project I know that a \"git email\" will generate the correct \nsort of patch for this project.\n\nThe thing that's missing is a config option to make git-commit add the signoff \nautomatically.  I think this would be useful, as \"signing off\" is probably a \nper-project decision rather than a per-commit decision.  It seems awkward to \nrequire the user to remember what the project policy is and always get the \nright git-commit for each project.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\n"},{"id":"295861","messageId":"Pine.LNX.4.63.0611281426311.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43177","inReplyTo":"200611281146.56201.andyparkins@gmail.com","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-28T13:28:25Z","receivedAt":"2006-11-28T13:28:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 28 Nov 2006, Andy Parkins wrote:\n\n> The thing that's missing is a config option to make git-commit add the \n> signoff automatically.\n\nNo. As has been often said, a signoff _has_ to be a conscious act, or else \nit will lose its meaning.\n\nOnce you are reasonably convinced you want to sign off on that commit, \njust add \"-s\" to git-commit. And if you forgot, fix it by \"git commit -s \n--amend\". (Note that this is another nice example why \"-a\" by default \nwould be wrong, wrong, wrong.)\n\nCiao,\nDscho\n"},{"id":"294650","messageId":"200611281403.36370.andyparkins@gmail.com","threadId":"43177","inReplyTo":"Pine.LNX.4.63.0611281426311.30004@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-28T14:03:35Z","receivedAt":"2006-11-28T14:03:35Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2006 November 28 13:28, Johannes Schindelin wrote:\n\n> No. As has been often said, a signoff _has_ to be a conscious act, or else\n> it will lose its meaning.\n\nI'm not suggesting that a project integrator would have that switch on, but \nfor me, in my own repository, where I am the only person writing patches, \nwhat possible case is there that I won't sign off?\n\n> Once you are reasonably convinced you want to sign off on that commit,\n\nI am always convinced.  Perhaps I am doing wrong - please explain to me under \nwhat circumstance I would /not/ want to sign off on a commit.  (assuming I am \nacting merely as a developer on a project, I am not accepting patches from \nanyone but me).\n\n> just add \"-s\" to git-commit. And if you forgot, fix it by \"git commit -s\n> --amend\". (Note that this is another nice example why \"-a\" by default\n> would be wrong, wrong, wrong.)\n\nI don't see what one has to do with the other.  There are good arguments for \nnot having \"-a\" default, but signing off isn't one of them.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\n"},{"id":"297860","messageId":"Pine.LNX.4.63.0611281536230.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43177","inReplyTo":"200611281403.36370.andyparkins@gmail.com","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-28T14:40:50Z","receivedAt":"2006-11-28T14:40:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 28 Nov 2006, Andy Parkins wrote:\n\n> On Tuesday 2006 November 28 13:28, Johannes Schindelin wrote:\n> \n> > No. As has been often said, a signoff _has_ to be a conscious act, or else\n> > it will lose its meaning.\n> \n> I'm not suggesting that a project integrator would have that switch on, \n> but for me, in my own repository, where I am the only person writing \n> patches, what possible case is there that I won't sign off?\n\nYou are probably different than me. What with my track record, I _trust_ \nmy patches to be not perfect at all. Nevertheless, I commit here and now, \nand usually I regroup the commits into a nice patch (series) (AKA poor \nman's StGit).\n\nSo I will never need something like you suggest. Having said that, if you \nthink it is best for you to mark every commit as signed-off-by you, just \nadd an alias:\n\n\tgit repo-config --global alias.c \"commit -s\"\n\nand you're done. I highly doubt that it makes sense for the average \ndeveloper, though.\n"},{"id":"293977","messageId":"200611281506.53518.andyparkins@gmail.com","threadId":"43177","inReplyTo":"Pine.LNX.4.63.0611281536230.30004@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Andy Parkins","fromEmail":"andyparkins@gmail.com","sentAt":"2006-11-28T15:06:50Z","receivedAt":"2006-11-28T15:06:50Z","isPatch":true,"sender":{"key":"andyparkins@gmail.com","avatar":null},"body":"On Tuesday 2006 November 28 14:40, Johannes Schindelin wrote:\n\n> You are probably different than me. What with my track record, I _trust_\n> my patches to be not perfect at all. Nevertheless, I commit here and now,\n> and usually I regroup the commits into a nice patch (series) (AKA poor\n> man's StGit).\n\nI'm certainly not perfect, nor would I ever claim to be.  Perhaps I have \nmisunderstood the purpose of the Signed-Off line.  I had understood it was a \nlegal tool to trace the provenance of a patch - not to sign off on it being \nbug free (which surely is impossible).\n\nSince I know that I, and I alone wrote that patch, I can sign off on it \nregardless of it being any good technically.\n\nThis is in agreement with my understanding of the \nDocumentation/SubmittingPatches file included with git.\n\n\"The sign-off is a simple line at the end of the explanation for\nthe patch, which certifies that you wrote it or otherwise have\nthe right to pass it on as a open-source patch.\"\n\n> So I will never need something like you suggest. Having said that, if you\n> think it is best for you to mark every commit as signed-off-by you, just\n> add an alias:\n>\n> \tgit repo-config --global alias.c \"commit -s\"\n\nThat requires that I introduce a new command; I want the existing command to \ndo The Right Thing.  Also; I certainly wouldn't want it global, as I said in \nmy original message - this is a per-project choice.  Some projects don't have \nSigned-Off lines, so there is no point there.\n\nIdeally, I'd be able to do\n        git repo-config alias.commit \"commit -s\"\nJust as I can with shell commands.\n\n\nAndy\n-- \nDr Andy Parkins, M Eng (hons), MIEE\n"},{"id":"297729","messageId":"20061128153144.GB28337@spearce.org","threadId":"43177","inReplyTo":"200611281506.53518.andyparkins@gmail.com","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-11-28T15:31:44Z","receivedAt":"2006-11-28T15:31:44Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> wrote:\n> > So I will never need something like you suggest. Having said that, if you\n> > think it is best for you to mark every commit as signed-off-by you, just\n> > add an alias:\n> >\n> > \tgit repo-config --global alias.c \"commit -s\"\n> \n> That requires that I introduce a new command; I want the existing command to \n> do The Right Thing.  Also; I certainly wouldn't want it global, as I said in \n> my original message - this is a per-project choice.  Some projects don't have \n> Signed-Off lines, so there is no point there.\n> \n> Ideally, I'd be able to do\n>         git repo-config alias.commit \"commit -s\"\n> Just as I can with shell commands.\n\nLong ago we decided that aliasing over shipped commands was a baaaad\nidea, as it might get a shell script into trouble when all of a\nsudden the \"-s\" option is being given to every commit invocation.\n\nBut you can install a commit-msg hook (.git/hooks/commit-msg)\nin any project you want to ensure a Signed-off-by line is in the\ncommit message for.  Its handed the COMMIT_EDITMSG file, which is\nwhat the message will be generated from.  Looking at the code for\ngit-commit.sh its perfectly OK if the hook edits the file too.\n\nFurther the hook could be interactive, prompting the user \"are\nyou sure you don't want to sign this commit?\" or can be skipped by\nhanding --no-verify to commit.\n\n\nI just learned about commit-msg hook the other day when I was reading\nthrough git-commit.sh and noticed I didn't implement invoking that\nparticular hook in git-gui...\n\n-- \n"},{"id":"297121","messageId":"7v3b834e75.fsf@assigned-by-dhcp.cox.net","threadId":"43177","inReplyTo":"200611281506.53518.andyparkins@gmail.com","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-11-28T18:29:50Z","receivedAt":"2006-11-28T18:29:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andy Parkins <andyparkins@gmail.com> writes:\n\n> On Tuesday 2006 November 28 14:40, Johannes Schindelin wrote:\n>\n>> You are probably different than me. What with my track record, I _trust_\n>> my patches to be not perfect at all...\n>\n> ...  I had understood it was a \n> legal tool to trace the provenance of a patch - not to sign off on it being \n> bug free (which surely is impossible).\n\nJohannes, Andy's interpretation is in line with the policy in\nSubmittingPatches.  S-o-b is about warranty of provenance, and\nnot about correctness or cheering (Acked-by).\n\nAnd I think it makes sense to add \"-s\" automatically to commits\nmade in a private working repository in which the developer who\nconfigured \"-s\" to be added automatically is the only person who\nmakes commits.  As already mentioned in the thread, one of the\nhooks should be usable for that.  And it certainly is a\npossibility to add a config to turn \"-s\" on.\n\nBut I suspect that it would be cleaner and more useful to teach\n\"git commit\" to use a commit message template per repository and\nput the S-o-b in there -- that mechanism would be usable for\nthings other than just S-o-b lines as projects see fit.\n\n"},{"id":"297410","messageId":"Pine.LNX.4.63.0611291029190.30004@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"43177","inReplyTo":"7v3b834e75.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Trim hint printed when gecos is empty.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2006-11-29T09:29:36Z","receivedAt":"2006-11-29T09:29:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 28 Nov 2006, Junio C Hamano wrote:\n\n> Johannes, Andy's interpretation is in line with the policy in \n> SubmittingPatches.  S-o-b is about warranty of provenance, and not about \n> correctness or cheering (Acked-by).\n\nFair enough.\n\nCiao,\n"}]}