git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Using Environment variable GIT_CONFIG does not work as expected
@ 2018-07-30  8:58 Mika Vesalainen
  2018-07-30 13:07 ` SZEDER Gábor
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Vesalainen @ 2018-07-30  8:58 UTC (permalink / raw)
  To: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

Hi,

I have a shared linux account which is used by multiple developers. But I would like to have git commit history configured so that I can see who made a change to common repository (so that author of the commit would be correct person, not shared user). There are reasons why developers cannot clone this environment to their own accounts.

So I don't have ~/.gitconfig in place for the shared user, and when developer log in I enforce them to configure git for them first. They must "export GIT_CONFIG=my_specific_gitconfig".
When this is done, "git config -l" will show correctly the user.name, user.email and other parameters which are set in "my_specific_gitconfig".

However, if user tries now to create a commit the git blames:
*** Please tell me who you are.
and so on...

But running "git config -l" shows that 'user.name' and 'user.email' are properly configured.
Do I need to configure something more in order to get this GIT_CONFIG environment variable working. I'm working in Debian Linux environment.

I have tested this with git versions: 2.1.4, 2.11.0 and 2.18.0.321.gffc6fa0

Thanks,
Mika



[-- Attachment #2: Type: text/html, Size: 1889 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Using Environment variable GIT_CONFIG does not work as expected
  2018-07-30  8:58 Using Environment variable GIT_CONFIG does not work as expected Mika Vesalainen
@ 2018-07-30 13:07 ` SZEDER Gábor
  0 siblings, 0 replies; 2+ messages in thread
From: SZEDER Gábor @ 2018-07-30 13:07 UTC (permalink / raw)
  To: Mika Vesalainen; +Cc: SZEDER Gábor, git@vger.kernel.org

> I have a shared linux account which is used by multiple developers.
> But I would like to have git commit history configured so that I can
> see who made a change to common repository (so that author of the
> commit would be correct person, not shared user). There are reasons
> why developers cannot clone this environment to their own accounts.
> 
> So I don't have ~/.gitconfig in place for the shared user, and when
> developer log in I enforce them to configure git for them first. They
> must "export GIT_CONFIG=my_specific_gitconfig".
> When this is done, "git config -l" will show correctly the user.name,
> user.email and other parameters which are set in
> "my_specific_gitconfig".
> 
> However, if user tries now to create a commit the git blames:
> *** Please tell me who you are.
> and so on...
> 
> But running "git config -l" shows that 'user.name' and 'user.email'
> are properly configured.
> Do I need to configure something more in order to get this GIT_CONFIG
> environment variable working. I'm working in Debian Linux environment.

I think it's working as intended, because GIT_CONFIG is only supposed
to affect 'git config' and is only documented in the git-config(1) man
page.  Perhaps the wording could be improved to be more explicit about
this.

Note that more general environment variables affecting more git
commands are documented in git(1), and GIT_CONFIG is not mentioned
there.

Try setting and exporting the environment variables GIT_AUTHOR_NAME,
GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, and GIT_COMMITTER_EMAIL instead.

> 
> I have tested this with git versions: 2.1.4, 2.11.0 and
> 2.18.0.321.gffc6fa0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-30 13:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-30  8:58 Using Environment variable GIT_CONFIG does not work as expected Mika Vesalainen
2018-07-30 13:07 ` SZEDER Gábor

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).