git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about include feature in .gitconfig
@ 2012-04-04 21:09 Shouichi KAMIYA
  2012-04-04 21:15 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Shouichi KAMIYA @ 2012-04-04 21:09 UTC (permalink / raw)
  To: git

Hello git users and developers,

I have a question about "include" feature in config file.
In .gitconfig I included .my_super_secret_file like below.

# .gitconfig
[include]
    path = .my_super_secret_file

# .my_super_secret_file
[github]
    password = foobar

Now, my question is return value of "git config --global github.password".
I expect it to return foobar but it returns nothing. Is this behavior expected?

Cheers!
Shouichi

-- 
Shouichi KAMIYA

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

* Re: Question about include feature in .gitconfig
  2012-04-04 21:09 Question about include feature in .gitconfig Shouichi KAMIYA
@ 2012-04-04 21:15 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2012-04-04 21:15 UTC (permalink / raw)
  To: Shouichi KAMIYA; +Cc: git

On Thu, Apr 05, 2012 at 06:09:41AM +0900, Shouichi KAMIYA wrote:

> I have a question about "include" feature in config file.
> In .gitconfig I included .my_super_secret_file like below.
> 
> # .gitconfig
> [include]
>     path = .my_super_secret_file
> 
> # .my_super_secret_file
> [github]
>     password = foobar
> 
> Now, my question is return value of "git config --global github.password".
> I expect it to return foobar but it returns nothing. Is this behavior expected?

Yes, that's the expected behavior. Includes are not followed by default
when you ask for the value from a _specific_ file, as you do with
"--global".

If you do "git config github.password", you will get the answer you
want. You can also use "git config --includes --global github.password"
if you want to search only ~/.gitconfig, but following includes.

-Peff

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

end of thread, other threads:[~2012-04-04 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-04 21:09 Question about include feature in .gitconfig Shouichi KAMIYA
2012-04-04 21:15 ` Jeff King

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).