git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Is it possible to use new conditional includes outside of git dir?
@ 2017-05-15 18:09 Mihails Strasuns
  2017-05-15 21:00 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 3+ messages in thread
From: Mihails Strasuns @ 2017-05-15 18:09 UTC (permalink / raw)
  To: git


[-- Attachment #1.1: Type: text/plain, Size: 692 bytes --]

Hello,

I was very excited to try out new conditional include feature but have
quickly found out that it doesn't work with some of my custom scripts
because of the following behaviour:

# .gitconfig
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig.work
[user]
name1 = Someone

# .gitconfig.work
[user]
name2 = SomeoneElse
$ cd ~/work; git config user.name1 # "Someone"
$ cd ~/work ; git config user.name2 # <nothing>

I see that it matches current `git config` documentation - indeed, it
mentions only matching on git directory and not arbitrary file path. I
wonder though, if this limitation is intentional and what is the
rationale behind it?

Thank you,
Michael


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 525 bytes --]

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

* Re: Is it possible to use new conditional includes outside of git dir?
  2017-05-15 18:09 Is it possible to use new conditional includes outside of git dir? Mihails Strasuns
@ 2017-05-15 21:00 ` Ævar Arnfjörð Bjarmason
  2017-05-18 11:50   ` Mihails Strasuns
  0 siblings, 1 reply; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-05-15 21:00 UTC (permalink / raw)
  To: Mihails Strasuns; +Cc: Git Mailing List, Raphael Stolt

On Mon, May 15, 2017 at 8:09 PM, Mihails Strasuns
<mihails.strasuns@gmail.com> wrote:
> I was very excited to try out new conditional include feature but have
> quickly found out that it doesn't work with some of my custom scripts
> because of the following behaviour:
>
> # .gitconfig
> [includeIf "gitdir:~/work/"]
> path = ~/.gitconfig.work
> [user]
> name1 = Someone
>
> # .gitconfig.work
> [user]
> name2 = SomeoneElse
> $ cd ~/work; git config user.name1 # "Someone"
> $ cd ~/work ; git config user.name2 # <nothing>
>
> I see that it matches current `git config` documentation - indeed, it
> mentions only matching on git directory and not arbitrary file path. I
> wonder though, if this limitation is intentional and what is the
> rationale behind it?

It's intentional, but in the "that's how this works" sense, not "we'll
never add what you just asked for".

This came up on list last week:
https://public-inbox.org/git/F55DC360-9C1E-45B9-B8BA-39E1001BD620@gmail.com/T/#u

So I'd like to ask you the same question I asked Raphael in that thread.

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

* Re: Is it possible to use new conditional includes outside of git dir?
  2017-05-15 21:00 ` Ævar Arnfjörð Bjarmason
@ 2017-05-18 11:50   ` Mihails Strasuns
  0 siblings, 0 replies; 3+ messages in thread
From: Mihails Strasuns @ 2017-05-18 11:50 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Git Mailing List, Raphael Stolt


[-- Attachment #1.1: Type: text/plain, Size: 901 bytes --]

On 05/15/2017 11:00 PM, Ævar Arnfjörð Bjarmason wrote:
> It's intentional, but in the "that's how this works" sense, not "we'll
> never add what you just asked for".
> 
> This came up on list last week:
> https://public-inbox.org/git/F55DC360-9C1E-45B9-B8BA-39E1001BD620@gmail.com/T/#u
> 
> So I'd like to ask you the same question I asked Raphael in that thread.

This came from the GitHub CLI tool I use
(https://github.com/sociomantic-tsunami/git-hub) which stores own
configuration in git config (i.e. `git config hub.oauthtoken`). Some of
its command run outside of the repository context, for example `git hub
clone` ensures creation of a personal fork before doing regular clone
and thus needs access to the token.

Thus I hoped that I will be able to use new git functionality to
distinguish between work and personal GitHub accounts same as it is done
for name/email.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 525 bytes --]

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

end of thread, other threads:[~2017-05-18 11:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15 18:09 Is it possible to use new conditional includes outside of git dir? Mihails Strasuns
2017-05-15 21:00 ` Ævar Arnfjörð Bjarmason
2017-05-18 11:50   ` Mihails Strasuns

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