{"thread":{"id":"16592","subject":"git-gui: Warn when username and e-mail address is unconfigured?","startedAt":"2008-12-04T10:43:15Z","lastAt":"2008-12-12T02:37:17Z","messageCount":10,"participants":["Peter Krefting","Jeremy Ramer","Sverre Rabbelier","Alexander Gavrilov","Junio C Hamano","jidanni@jidanni.org"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"97140","messageId":"Pine.LNX.4.64.0812041141160.9969@ds9.cixit.se","threadId":"16592","inReplyTo":null,"subject":"git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Peter Krefting","fromEmail":"peter@softwolves.pp.se","sentAt":"2008-12-04T10:43:15Z","receivedAt":"2008-12-04T10:43:15Z","isPatch":false,"sender":{"key":"peter@softwolves.pp.se","avatar":"https://avatars.githubusercontent.com/u/990764?v=4"},"body":"Hi!\n\nWhen using Git on Windows, it doesn't pick up a user name from the\nenvironment, which leads to commits made by git gui (and probably by\ngit itself) to show up as being made by \"unknown <username@.(none)>\"\n(where \"username\" is the Windows account name).\n\nIs it possible to add a warning to git-gui the first time a commit is\nattempted if the e-mail address is not configured, and have the user\nopen the configuration dialogue to set up the name properly?\n\n-- \n\\\\// Peter - http://www.softwolves.pp.se/\n"},{"id":"97149","messageId":"b9fd99020812040805j1143c029yf0cc4c1c4a835759@mail.gmail.com","threadId":"16592","inReplyTo":"Pine.LNX.4.64.0812041141160.9969@ds9.cixit.se","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Jeremy Ramer","fromEmail":"jdramer@gmail.com","sentAt":"2008-12-04T16:05:36Z","receivedAt":"2008-12-04T16:05:36Z","isPatch":false,"sender":{"key":"jdramer@gmail.com","avatar":null},"body":"On Thu, Dec 4, 2008 at 3:43 AM, Peter Krefting <peter@softwolves.pp.se> wrote:\n> Hi!\n>\n> When using Git on Windows, it doesn't pick up a user name from the\n> environment, which leads to commits made by git gui (and probably by\n> git itself) to show up as being made by \"unknown <username@.(none)>\"\n> (where \"username\" is the Windows account name).\n\nThat's strange. I am using git 1.6.0.4 on cygwin and I get a warning\nmessage every time I start git gui.  I actually find this really\nannoying and would like a way to turn this warning message off.\n\n>\n> Is it possible to add a warning to git-gui the first time a commit is\n> attempted if the e-mail address is not configured, and have the user\n> open the configuration dialogue to set up the name properly?\n>\n> --\n> \\\\// Peter - http://www.softwolves.pp.se/\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"97161","messageId":"bd6139dc0812041104s26ae149foeafa489e65aeb584@mail.gmail.com","threadId":"16592","inReplyTo":"b9fd99020812040805j1143c029yf0cc4c1c4a835759@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Sverre Rabbelier","fromEmail":"alturin@gmail.com","sentAt":"2008-12-04T19:04:34Z","receivedAt":"2008-12-04T19:04:34Z","isPatch":false,"sender":{"key":"alturin@gmail.com","avatar":null},"body":"On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote:\n> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning\n> message every time I start git gui.  I actually find this really\n> annoying and would like a way to turn this warning message off.\n\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"you@example.com\"\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"97170","messageId":"b9fd99020812041254l5d1fa383m4fcc3b40f6fabacb@mail.gmail.com","threadId":"16592","inReplyTo":"bd6139dc0812041104s26ae149foeafa489e65aeb584@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Jeremy Ramer","fromEmail":"jdramer@gmail.com","sentAt":"2008-12-04T20:54:00Z","receivedAt":"2008-12-04T20:54:00Z","isPatch":false,"sender":{"key":"jdramer@gmail.com","avatar":null},"body":"On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote:\n> On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote:\n>> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning\n>> message every time I start git gui.  I actually find this really\n>> annoying and would like a way to turn this warning message off.\n>\n> git config --global user.name \"Your Name\"\n> git config --global user.email \"you@example.com\"\n>\n\nI have done that.  I still get the warning message every time I start git gui.\n"},{"id":"97172","messageId":"200812050030.16467.angavrilov@gmail.com","threadId":"16592","inReplyTo":"b9fd99020812041254l5d1fa383m4fcc3b40f6fabacb@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Alexander Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-12-04T21:30:15Z","receivedAt":"2008-12-04T21:30:15Z","isPatch":false,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"On Thursday 04 December 2008 23:54:00 Jeremy Ramer wrote:\n> On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote:\n> > On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote:\n> >> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning\n> >> message every time I start git gui.  I actually find this really\n> >> annoying and would like a way to turn this warning message off.\n> >\n> > git config --global user.name \"Your Name\"\n> > git config --global user.email \"you@example.com\"\n> >\n> \n> I have done that.  I still get the warning message every time I start git gui.\n> --\n\nWhat does it say precisely? I.e. is it perhaps the warning about subprocesses\npossibly ignoring the value of environment variables?\n\nAlexander\n"},{"id":"97173","messageId":"7vskp3d3q9.fsf@gitster.siamese.dyndns.org","threadId":"16592","inReplyTo":"b9fd99020812041254l5d1fa383m4fcc3b40f6fabacb@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-12-04T21:34:22Z","receivedAt":"2008-12-04T21:34:22Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Jeremy Ramer\" <jdramer@gmail.com> writes:\n\n> On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote:\n>> On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote:\n>>> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning\n>>> message every time I start git gui.  I actually find this really\n>>> annoying and would like a way to turn this warning message off.\n>>\n>> git config --global user.name \"Your Name\"\n>> git config --global user.email \"you@example.com\"\n>>\n>\n> I have done that.  I still get the warning message every time I start git gui.\n\nI do not use Windows, and I do not run git-gui, so I am guessing only from\nthe source.  Are you talking about the message composed by this part?\n\n    # -- Warn the user about environmental problems.  Cygwin's Tcl\n    #    does *not* pass its env array onto any processes it spawns.\n    #    This means that git processes get none of our environment.\n    #\n    if {[is_Cygwin]} {\n            set ignored_env 0\n            set suggest_user {}\n            set msg [mc \"Possible environment issues exist.\n\n    The following environment variables are probably\n    going to be ignored by any Git subprocess run\n    by %s:\n\n    \" [appname]]\n\nThe logic to produce the error message does look somewhat screwy.\n\nIt checks a selected set of variables whose name begin with GIT_ in the\nenvironment, and if it finds any, it gives the above message.  In\naddition, if GIT_{AUTHOR,COMMITTER}_{EMAIL,NAME} are among them, it also\nadds this to the message:\n\n                    if {$suggest_user ne {}} {\n                            append msg [mc \"\n    A good replacement for %s\n    is placing values for the user.name and\n    user.email settings into your personal\n    ~/.gitconfig file.\n    \" $suggest_user]\n\nThere are two and half issues about this code.\n\n (1) When it prepares additional message about user.{email,name},\n     it does not check if the user already has them defined.  IOW, there\n     is no way other than unsetenv before running git-gui to squelch this\n     part of the message.\n\n (2) For other environment variables, such as GIT_PAGER, it does not offer\n     alternatives, such as core.pager.  Again, there is no way other than\n     unsetenv to squelch the warning.\n\nAn excuse to both of the above could be that the warning is not about the\nuser having environment variables that can be discarded, but about\nbrokenness of Cygwin Tcl envirnonment that discards them.  But if that is\nthe case, there is this other half issue:\n\n (3) The warning does not trigger if the environment is not set when this\n     check is made.  Now I do not know if git-gui tries to spawn\n     subprocesses with its own (customized) environment settings (e.g. you\n     would need to be able to run git-commit-tree with modified\n     GIT_AUTHOR_NAME if you want to use the lowlevel plumbing to create a\n     new commit and lie about the author identity), but if it does, the\n     warning does not trigger.\n"},{"id":"97182","messageId":"b9fd99020812041558w204e5f48gbed73fdbd289ad@mail.gmail.com","threadId":"16592","inReplyTo":"7vskp3d3q9.fsf@gitster.siamese.dyndns.org","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Jeremy Ramer","fromEmail":"jdramer@gmail.com","sentAt":"2008-12-04T23:58:28Z","receivedAt":"2008-12-04T23:58:28Z","isPatch":false,"sender":{"key":"jdramer@gmail.com","avatar":null},"body":"On Thu, Dec 4, 2008 at 2:34 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> \"Jeremy Ramer\" <jdramer@gmail.com> writes:\n>\n>> On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote:\n>>> On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote:\n>>>> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning\n>>>> message every time I start git gui.  I actually find this really\n>>>> annoying and would like a way to turn this warning message off.\n>>>\n>>> git config --global user.name \"Your Name\"\n>>> git config --global user.email \"you@example.com\"\n>>>\n>>\n>> I have done that.  I still get the warning message every time I start git gui.\n>\n> I do not use Windows, and I do not run git-gui, so I am guessing only from\n> the source.  Are you talking about the message composed by this part?\n>\n>    # -- Warn the user about environmental problems.  Cygwin's Tcl\n>    #    does *not* pass its env array onto any processes it spawns.\n>    #    This means that git processes get none of our environment.\n>    #\n>    if {[is_Cygwin]} {\n>            set ignored_env 0\n>            set suggest_user {}\n>            set msg [mc \"Possible environment issues exist.\n>\n>    The following environment variables are probably\n>    going to be ignored by any Git subprocess run\n>    by %s:\n>\n>    \" [appname]]\n\nYes, that does appear to be the message I get, with the following\nenvironment variables:\n- GIT_AUTHOR_EMAIL\n- GIT_COMMITTER_NAME\n- GIT_COMMITER_EMAIL\n- GIT_AUTHOR_NAME\n\nNow that I look closer I see that I am setting these in my .bashrc\nfile.  When I first started using git a year ago I was given the\nimpression that these were needed. But I see that that is no longer\nthe case since I use the config:\n\ngit config --global user.name \"Your Name\"\ngit config --global user.email \"you@example.com\"\n\nRemoving them from my .bashrc removes the warning.  In hindsight the\nwarning should have clued me in, but I've been seeing that message\nsince I first started using git on Cygwin so I figured it was a cygwin\nissue that I couldn't do anything about.\n\n>\n> The logic to produce the error message does look somewhat screwy.\n>\n> It checks a selected set of variables whose name begin with GIT_ in the\n> environment, and if it finds any, it gives the above message.  In\n> addition, if GIT_{AUTHOR,COMMITTER}_{EMAIL,NAME} are among them, it also\n> adds this to the message:\n>\n>                    if {$suggest_user ne {}} {\n>                            append msg [mc \"\n>    A good replacement for %s\n>    is placing values for the user.name and\n>    user.email settings into your personal\n>    ~/.gitconfig file.\n>    \" $suggest_user]\n>\n> There are two and half issues about this code.\n>\n>  (1) When it prepares additional message about user.{email,name},\n>     it does not check if the user already has them defined.  IOW, there\n>     is no way other than unsetenv before running git-gui to squelch this\n>     part of the message.\n>\n>  (2) For other environment variables, such as GIT_PAGER, it does not offer\n>     alternatives, such as core.pager.  Again, there is no way other than\n>     unsetenv to squelch the warning.\n>\n> An excuse to both of the above could be that the warning is not about the\n> user having environment variables that can be discarded, but about\n> brokenness of Cygwin Tcl envirnonment that discards them.  But if that is\n> the case, there is this other half issue:\n>\n>  (3) The warning does not trigger if the environment is not set when this\n>     check is made.  Now I do not know if git-gui tries to spawn\n>     subprocesses with its own (customized) environment settings (e.g. you\n>     would need to be able to run git-commit-tree with modified\n>     GIT_AUTHOR_NAME if you want to use the lowlevel plumbing to create a\n>     new commit and lie about the author identity), but if it does, the\n>     warning does not trigger.\n>\n\nI agree that the logic could using improvement.\n"},{"id":"97202","messageId":"bb6f213e0812050301t2f18061epfeff7bc74ee6f28a@mail.gmail.com","threadId":"16592","inReplyTo":"b9fd99020812041558w204e5f48gbed73fdbd289ad@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Alexander Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-12-05T11:01:48Z","receivedAt":"2008-12-05T11:01:48Z","isPatch":false,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"On Fri, Dec 5, 2008 at 2:58 AM, Jeremy Ramer <jdramer@gmail.com> wrote:\n> Yes, that does appear to be the message I get, with the following\n> environment variables:\n> - GIT_AUTHOR_EMAIL\n> - GIT_COMMITTER_NAME\n> - GIT_COMMITER_EMAIL\n> - GIT_AUTHOR_NAME\n>\n> Now that I look closer I see that I am setting these in my .bashrc\n> file.  When I first started using git a year ago I was given the\n> impression that these were needed. But I see that that is no longer\n> the case since I use the config:\n>\n> git config --global user.name \"Your Name\"\n> git config --global user.email \"you@example.com\"\n>\n> Removing them from my .bashrc removes the warning.  In hindsight the\n> warning should have clued me in, but I've been seeing that message\n> since I first started using git on Cygwin so I figured it was a cygwin\n> issue that I couldn't do anything about.\n>\n\nI wonder if what the warning says is still true. It's 2 years since\nit was added, so the issue might have been fixed.\n\nIf you run \"GIT_AUTHOR_NAME=foobar git gui\", and make a commit,\ndoes it set the author name to 'foobar'?\n\nAlexander\n"},{"id":"97214","messageId":"b9fd99020812051218o1c337148u12b8e190c60f32eb@mail.gmail.com","threadId":"16592","inReplyTo":"bb6f213e0812050301t2f18061epfeff7bc74ee6f28a@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"Jeremy Ramer","fromEmail":"jdramer@gmail.com","sentAt":"2008-12-05T20:18:54Z","receivedAt":"2008-12-05T20:18:54Z","isPatch":false,"sender":{"key":"jdramer@gmail.com","avatar":null},"body":"On Fri, Dec 5, 2008 at 4:01 AM, Alexander Gavrilov <angavrilov@gmail.com> wrote:\n> On Fri, Dec 5, 2008 at 2:58 AM, Jeremy Ramer <jdramer@gmail.com> wrote:\n>> Yes, that does appear to be the message I get, with the following\n>> environment variables:\n>> - GIT_AUTHOR_EMAIL\n>> - GIT_COMMITTER_NAME\n>> - GIT_COMMITER_EMAIL\n>> - GIT_AUTHOR_NAME\n>>\n>> Now that I look closer I see that I am setting these in my .bashrc\n>> file.  When I first started using git a year ago I was given the\n>> impression that these were needed. But I see that that is no longer\n>> the case since I use the config:\n>>\n>> git config --global user.name \"Your Name\"\n>> git config --global user.email \"you@example.com\"\n>>\n>> Removing them from my .bashrc removes the warning.  In hindsight the\n>> warning should have clued me in, but I've been seeing that message\n>> since I first started using git on Cygwin so I figured it was a cygwin\n>> issue that I couldn't do anything about.\n>>\n>\n> I wonder if what the warning says is still true. It's 2 years since\n> it was added, so the issue might have been fixed.\n>\n> If you run \"GIT_AUTHOR_NAME=foobar git gui\", and make a commit,\n> does it set the author name to 'foobar'?\n\nI ran\nexport GIT_AUTHOR_NAME=\"foobar git gui\"\nand then made a commit with git gui and it did not set the author name\nto foobar.  It used my global config name.\n\n>\n> Alexander\n>\n"},{"id":"97659","messageId":"87ljumi0f6.fsf@jidanni.org","threadId":"16592","inReplyTo":"b9fd99020812051218o1c337148u12b8e190c60f32eb@mail.gmail.com","subject":"Re: git-gui: Warn when username and e-mail address is unconfigured?","fromName":"","fromEmail":"jidanni@jidanni.org","sentAt":"2008-12-12T02:37:17Z","receivedAt":"2008-12-12T02:37:17Z","isPatch":false,"sender":{"key":"jidanni@jidanni.org","avatar":"https://gravatar.com/avatar/36568d4af4c8d3e71627ef3b8c8d00e39065b12f29676cccd38ced75e68fa2a6?d=mp&s=160"},"body":"On git-commit-tree(1)\n  DIAGNOSTICS\n       You don't exist. Go away!\n           The passwd(5) gecos field couldn't be read\n\nIt should say that null is OK though.\njidanni:x:1000:1000:,,,:/home/jidanni:/bin/bash\ngives\n Committer: jidanni <jidanni@jidanni.org>\nwhich is what I want. No old fashioned English name for me.\n"}]}