* git-gui: Warn when username and e-mail address is unconfigured? @ 2008-12-04 10:43 Peter Krefting 2008-12-04 16:05 ` Jeremy Ramer 0 siblings, 1 reply; 10+ messages in thread From: Peter Krefting @ 2008-12-04 10:43 UTC (permalink / raw) To: Git Mailing List Hi! When using Git on Windows, it doesn't pick up a user name from the environment, which leads to commits made by git gui (and probably by git itself) to show up as being made by "unknown <username@.(none)>" (where "username" is the Windows account name). Is it possible to add a warning to git-gui the first time a commit is attempted if the e-mail address is not configured, and have the user open the configuration dialogue to set up the name properly? -- \\// Peter - http://www.softwolves.pp.se/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 10:43 git-gui: Warn when username and e-mail address is unconfigured? Peter Krefting @ 2008-12-04 16:05 ` Jeremy Ramer 2008-12-04 19:04 ` Sverre Rabbelier 0 siblings, 1 reply; 10+ messages in thread From: Jeremy Ramer @ 2008-12-04 16:05 UTC (permalink / raw) To: Peter Krefting; +Cc: Git Mailing List On Thu, Dec 4, 2008 at 3:43 AM, Peter Krefting <peter@softwolves.pp.se> wrote: > Hi! > > When using Git on Windows, it doesn't pick up a user name from the > environment, which leads to commits made by git gui (and probably by > git itself) to show up as being made by "unknown <username@.(none)>" > (where "username" is the Windows account name). That's strange. I am using git 1.6.0.4 on cygwin and I get a warning message every time I start git gui. I actually find this really annoying and would like a way to turn this warning message off. > > Is it possible to add a warning to git-gui the first time a commit is > attempted if the e-mail address is not configured, and have the user > open the configuration dialogue to set up the name properly? > > -- > \\// Peter - http://www.softwolves.pp.se/ > -- > To unsubscribe from this list: send the line "unsubscribe git" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 16:05 ` Jeremy Ramer @ 2008-12-04 19:04 ` Sverre Rabbelier 2008-12-04 20:54 ` Jeremy Ramer 0 siblings, 1 reply; 10+ messages in thread From: Sverre Rabbelier @ 2008-12-04 19:04 UTC (permalink / raw) To: Jeremy Ramer; +Cc: Peter Krefting, Git Mailing List On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote: > That's strange. I am using git 1.6.0.4 on cygwin and I get a warning > message every time I start git gui. I actually find this really > annoying and would like a way to turn this warning message off. git config --global user.name "Your Name" git config --global user.email "you@example.com" -- Cheers, Sverre Rabbelier ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 19:04 ` Sverre Rabbelier @ 2008-12-04 20:54 ` Jeremy Ramer 2008-12-04 21:30 ` Alexander Gavrilov 2008-12-04 21:34 ` Junio C Hamano 0 siblings, 2 replies; 10+ messages in thread From: Jeremy Ramer @ 2008-12-04 20:54 UTC (permalink / raw) To: sverre; +Cc: Peter Krefting, Git Mailing List On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote: > On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote: >> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning >> message every time I start git gui. I actually find this really >> annoying and would like a way to turn this warning message off. > > git config --global user.name "Your Name" > git config --global user.email "you@example.com" > I have done that. I still get the warning message every time I start git gui. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 20:54 ` Jeremy Ramer @ 2008-12-04 21:30 ` Alexander Gavrilov 2008-12-04 21:34 ` Junio C Hamano 1 sibling, 0 replies; 10+ messages in thread From: Alexander Gavrilov @ 2008-12-04 21:30 UTC (permalink / raw) To: Jeremy Ramer; +Cc: sverre, Peter Krefting, Git Mailing List On Thursday 04 December 2008 23:54:00 Jeremy Ramer wrote: > On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote: > > On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote: > >> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning > >> message every time I start git gui. I actually find this really > >> annoying and would like a way to turn this warning message off. > > > > git config --global user.name "Your Name" > > git config --global user.email "you@example.com" > > > > I have done that. I still get the warning message every time I start git gui. > -- What does it say precisely? I.e. is it perhaps the warning about subprocesses possibly ignoring the value of environment variables? Alexander ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 20:54 ` Jeremy Ramer 2008-12-04 21:30 ` Alexander Gavrilov @ 2008-12-04 21:34 ` Junio C Hamano 2008-12-04 23:58 ` Jeremy Ramer 1 sibling, 1 reply; 10+ messages in thread From: Junio C Hamano @ 2008-12-04 21:34 UTC (permalink / raw) To: Jeremy Ramer; +Cc: spearce, sverre, Peter Krefting, Git Mailing List "Jeremy Ramer" <jdramer@gmail.com> writes: > On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote: >> On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote: >>> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning >>> message every time I start git gui. I actually find this really >>> annoying and would like a way to turn this warning message off. >> >> git config --global user.name "Your Name" >> git config --global user.email "you@example.com" >> > > I have done that. I still get the warning message every time I start git gui. I do not use Windows, and I do not run git-gui, so I am guessing only from the source. Are you talking about the message composed by this part? # -- Warn the user about environmental problems. Cygwin's Tcl # does *not* pass its env array onto any processes it spawns. # This means that git processes get none of our environment. # if {[is_Cygwin]} { set ignored_env 0 set suggest_user {} set msg [mc "Possible environment issues exist. The following environment variables are probably going to be ignored by any Git subprocess run by %s: " [appname]] The logic to produce the error message does look somewhat screwy. It checks a selected set of variables whose name begin with GIT_ in the environment, and if it finds any, it gives the above message. In addition, if GIT_{AUTHOR,COMMITTER}_{EMAIL,NAME} are among them, it also adds this to the message: if {$suggest_user ne {}} { append msg [mc " A good replacement for %s is placing values for the user.name and user.email settings into your personal ~/.gitconfig file. " $suggest_user] There are two and half issues about this code. (1) When it prepares additional message about user.{email,name}, it does not check if the user already has them defined. IOW, there is no way other than unsetenv before running git-gui to squelch this part of the message. (2) For other environment variables, such as GIT_PAGER, it does not offer alternatives, such as core.pager. Again, there is no way other than unsetenv to squelch the warning. An excuse to both of the above could be that the warning is not about the user having environment variables that can be discarded, but about brokenness of Cygwin Tcl envirnonment that discards them. But if that is the case, there is this other half issue: (3) The warning does not trigger if the environment is not set when this check is made. Now I do not know if git-gui tries to spawn subprocesses with its own (customized) environment settings (e.g. you would need to be able to run git-commit-tree with modified GIT_AUTHOR_NAME if you want to use the lowlevel plumbing to create a new commit and lie about the author identity), but if it does, the warning does not trigger. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 21:34 ` Junio C Hamano @ 2008-12-04 23:58 ` Jeremy Ramer 2008-12-05 11:01 ` Alexander Gavrilov 0 siblings, 1 reply; 10+ messages in thread From: Jeremy Ramer @ 2008-12-04 23:58 UTC (permalink / raw) To: Junio C Hamano; +Cc: spearce, sverre, Peter Krefting, Git Mailing List On Thu, Dec 4, 2008 at 2:34 PM, Junio C Hamano <gitster@pobox.com> wrote: > "Jeremy Ramer" <jdramer@gmail.com> writes: > >> On Thu, Dec 4, 2008 at 12:04 PM, Sverre Rabbelier <alturin@gmail.com> wrote: >>> On Thu, Dec 4, 2008 at 17:05, Jeremy Ramer <jdramer@gmail.com> wrote: >>>> That's strange. I am using git 1.6.0.4 on cygwin and I get a warning >>>> message every time I start git gui. I actually find this really >>>> annoying and would like a way to turn this warning message off. >>> >>> git config --global user.name "Your Name" >>> git config --global user.email "you@example.com" >>> >> >> I have done that. I still get the warning message every time I start git gui. > > I do not use Windows, and I do not run git-gui, so I am guessing only from > the source. Are you talking about the message composed by this part? > > # -- Warn the user about environmental problems. Cygwin's Tcl > # does *not* pass its env array onto any processes it spawns. > # This means that git processes get none of our environment. > # > if {[is_Cygwin]} { > set ignored_env 0 > set suggest_user {} > set msg [mc "Possible environment issues exist. > > The following environment variables are probably > going to be ignored by any Git subprocess run > by %s: > > " [appname]] Yes, that does appear to be the message I get, with the following environment variables: - GIT_AUTHOR_EMAIL - GIT_COMMITTER_NAME - GIT_COMMITER_EMAIL - GIT_AUTHOR_NAME Now that I look closer I see that I am setting these in my .bashrc file. When I first started using git a year ago I was given the impression that these were needed. But I see that that is no longer the case since I use the config: git config --global user.name "Your Name" git config --global user.email "you@example.com" Removing them from my .bashrc removes the warning. In hindsight the warning should have clued me in, but I've been seeing that message since I first started using git on Cygwin so I figured it was a cygwin issue that I couldn't do anything about. > > The logic to produce the error message does look somewhat screwy. > > It checks a selected set of variables whose name begin with GIT_ in the > environment, and if it finds any, it gives the above message. In > addition, if GIT_{AUTHOR,COMMITTER}_{EMAIL,NAME} are among them, it also > adds this to the message: > > if {$suggest_user ne {}} { > append msg [mc " > A good replacement for %s > is placing values for the user.name and > user.email settings into your personal > ~/.gitconfig file. > " $suggest_user] > > There are two and half issues about this code. > > (1) When it prepares additional message about user.{email,name}, > it does not check if the user already has them defined. IOW, there > is no way other than unsetenv before running git-gui to squelch this > part of the message. > > (2) For other environment variables, such as GIT_PAGER, it does not offer > alternatives, such as core.pager. Again, there is no way other than > unsetenv to squelch the warning. > > An excuse to both of the above could be that the warning is not about the > user having environment variables that can be discarded, but about > brokenness of Cygwin Tcl envirnonment that discards them. But if that is > the case, there is this other half issue: > > (3) The warning does not trigger if the environment is not set when this > check is made. Now I do not know if git-gui tries to spawn > subprocesses with its own (customized) environment settings (e.g. you > would need to be able to run git-commit-tree with modified > GIT_AUTHOR_NAME if you want to use the lowlevel plumbing to create a > new commit and lie about the author identity), but if it does, the > warning does not trigger. > I agree that the logic could using improvement. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-04 23:58 ` Jeremy Ramer @ 2008-12-05 11:01 ` Alexander Gavrilov 2008-12-05 20:18 ` Jeremy Ramer 0 siblings, 1 reply; 10+ messages in thread From: Alexander Gavrilov @ 2008-12-05 11:01 UTC (permalink / raw) To: Jeremy Ramer Cc: Junio C Hamano, spearce, sverre, Peter Krefting, Git Mailing List On Fri, Dec 5, 2008 at 2:58 AM, Jeremy Ramer <jdramer@gmail.com> wrote: > Yes, that does appear to be the message I get, with the following > environment variables: > - GIT_AUTHOR_EMAIL > - GIT_COMMITTER_NAME > - GIT_COMMITER_EMAIL > - GIT_AUTHOR_NAME > > Now that I look closer I see that I am setting these in my .bashrc > file. When I first started using git a year ago I was given the > impression that these were needed. But I see that that is no longer > the case since I use the config: > > git config --global user.name "Your Name" > git config --global user.email "you@example.com" > > Removing them from my .bashrc removes the warning. In hindsight the > warning should have clued me in, but I've been seeing that message > since I first started using git on Cygwin so I figured it was a cygwin > issue that I couldn't do anything about. > I wonder if what the warning says is still true. It's 2 years since it was added, so the issue might have been fixed. If you run "GIT_AUTHOR_NAME=foobar git gui", and make a commit, does it set the author name to 'foobar'? Alexander ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-05 11:01 ` Alexander Gavrilov @ 2008-12-05 20:18 ` Jeremy Ramer 2008-12-12 2:37 ` jidanni 0 siblings, 1 reply; 10+ messages in thread From: Jeremy Ramer @ 2008-12-05 20:18 UTC (permalink / raw) To: Alexander Gavrilov Cc: Junio C Hamano, spearce, sverre, Peter Krefting, Git Mailing List On Fri, Dec 5, 2008 at 4:01 AM, Alexander Gavrilov <angavrilov@gmail.com> wrote: > On Fri, Dec 5, 2008 at 2:58 AM, Jeremy Ramer <jdramer@gmail.com> wrote: >> Yes, that does appear to be the message I get, with the following >> environment variables: >> - GIT_AUTHOR_EMAIL >> - GIT_COMMITTER_NAME >> - GIT_COMMITER_EMAIL >> - GIT_AUTHOR_NAME >> >> Now that I look closer I see that I am setting these in my .bashrc >> file. When I first started using git a year ago I was given the >> impression that these were needed. But I see that that is no longer >> the case since I use the config: >> >> git config --global user.name "Your Name" >> git config --global user.email "you@example.com" >> >> Removing them from my .bashrc removes the warning. In hindsight the >> warning should have clued me in, but I've been seeing that message >> since I first started using git on Cygwin so I figured it was a cygwin >> issue that I couldn't do anything about. >> > > I wonder if what the warning says is still true. It's 2 years since > it was added, so the issue might have been fixed. > > If you run "GIT_AUTHOR_NAME=foobar git gui", and make a commit, > does it set the author name to 'foobar'? I ran export GIT_AUTHOR_NAME="foobar git gui" and then made a commit with git gui and it did not set the author name to foobar. It used my global config name. > > Alexander > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: git-gui: Warn when username and e-mail address is unconfigured? 2008-12-05 20:18 ` Jeremy Ramer @ 2008-12-12 2:37 ` jidanni 0 siblings, 0 replies; 10+ messages in thread From: jidanni @ 2008-12-12 2:37 UTC (permalink / raw) To: git On git-commit-tree(1) DIAGNOSTICS You don't exist. Go away! The passwd(5) gecos field couldn't be read It should say that null is OK though. jidanni:x:1000:1000:,,,:/home/jidanni:/bin/bash gives Committer: jidanni <jidanni@jidanni.org> which is what I want. No old fashioned English name for me. ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-12-12 2:38 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2008-12-04 10:43 git-gui: Warn when username and e-mail address is unconfigured? Peter Krefting 2008-12-04 16:05 ` Jeremy Ramer 2008-12-04 19:04 ` Sverre Rabbelier 2008-12-04 20:54 ` Jeremy Ramer 2008-12-04 21:30 ` Alexander Gavrilov 2008-12-04 21:34 ` Junio C Hamano 2008-12-04 23:58 ` Jeremy Ramer 2008-12-05 11:01 ` Alexander Gavrilov 2008-12-05 20:18 ` Jeremy Ramer 2008-12-12 2:37 ` jidanni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).