From: Junio C Hamano <gitster@pobox.com>
To: "Jeremy Ramer" <jdramer@gmail.com>
Cc: spearce@spearce.org, sverre@rabbelier.nl,
"Peter Krefting" <peter@softwolves.pp.se>,
"Git Mailing List" <git@vger.kernel.org>
Subject: Re: git-gui: Warn when username and e-mail address is unconfigured?
Date: Thu, 04 Dec 2008 13:34:22 -0800 [thread overview]
Message-ID: <7vskp3d3q9.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <b9fd99020812041254l5d1fa383m4fcc3b40f6fabacb@mail.gmail.com> (Jeremy Ramer's message of "Thu, 4 Dec 2008 13:54:00 -0700")
"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.
next prev parent reply other threads:[~2008-12-04 21:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vskp3d3q9.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jdramer@gmail.com \
--cc=peter@softwolves.pp.se \
--cc=spearce@spearce.org \
--cc=sverre@rabbelier.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).