Re: Git Conditional Includes Question (possible bug?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Colton Hurst <colton@xxxxxxxxxxxxxxx> writes:

> [Expectation] When I run `cd ~/colton/github/coltonhurst.com`
> (this is a valid git repo) and then run `git config user.email`, I
> expect ‘colton@xxxxxxxxxxxxxxx’ will be returned.
>
> [Actual Result] When I run `cd ~/colton/github/coltonhurst.com`
> (this is a valid git repo) and then run `git config user.email`,
> nothing is returned.

The relevant part of the per-user config are

> [user]
> 	name = Colton Hurst

This is not conditional, and applies when you are in the repository.

> [includeIf "gitdir:~/colton/github"]
> 	path = ~/colton/github/.gitconfig

This is conditional, and applies when you are in a repository whose
".git" location matches the glob pattern "~/colton/github".  The
location in question is "~/colton/github/coltonhurst.com", which
does not match the pattern, so it would be skipped.

> [includeIf "gitdir:~/colton/sourcehut"]
> 	path = ~/colton/sourcehut/.gitconfig

Likewise.

So, nobody sets user.email in your example.  Isn't it expected that
nothing is returned?

I wonder what happens when the second one is updated to

> [includeIf "gitdir:~/colton/github/"]
> 	path = ~/colton/github/.gitconfig

as "git config --help" says:

 * If the pattern ends with `/`, `**` will be automatically added. For
   example, the pattern `foo/` becomes `foo/**`. In other words, it
   matches "foo" and everything inside, recursively.

and "~/colton/github/**" as a pattern would match the path to the
repository in question.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux