# [Question] worktree vs. gitdir in [includeIf]

5 messages from 2021-07-08 to 2021-07-12. Participants: Randall S. Becker, Junio C Hamano.
Thread: https://gitlist.dev/t/56078

## Randall S. Becker, 2021-07-08 17:25

Subject: [Question] worktree vs. gitdir in [includeIf]
Message-ID: <003701d7741e$550b6510$ff222f30$@nexbridge.com>
URL: https://gitlist.dev/e/003701d7741e%24550b6510%24ff222f30%24%40nexbridge.com

```
Hi Git Team,

I am wondering whether there is, or are plans for, something analogous to [includeIf "worktree:path"] with a similar semantic to
[includeIf "gitdir:path"]. 

Thanks,
Randall

-- Brief whoami:
NonStop developer since approximately 211288444200000000
UNIX developer since approximately 421664400
-- In my real life, I talk too much.




```

## Junio C Hamano, 2021-07-08 18:11

Subject: Re: [Question] worktree vs. gitdir in [includeIf]
Message-ID: <xmqqk0m0brq1.fsf@gitster.g>
URL: https://gitlist.dev/e/xmqqk0m0brq1.fsf%40gitster.g
In-Reply-To: <003701d7741e$550b6510$ff222f30$@nexbridge.com>

```
"Randall S. Becker" <rsbecker@nexbridge.com> writes:

> I am wondering whether there is, or are plans for, something
> analogous to [includeIf "worktree:path"] with a similar semantic
> to [includeIf "gitdir:path"].

I do not think there currently is an implementation, nor a plan, but
I offhand do not see downsides in a feature to let you conditionally
enable some configuration based on the location of the worktree.

Thanks.

```

## Randall S. Becker, 2021-07-08 18:15

Subject: RE: [Question] worktree vs. gitdir in [includeIf]
Message-ID: <003a01d77425$4fe94aa0$efbbdfe0$@nexbridge.com>
URL: https://gitlist.dev/e/003a01d77425%244fe94aa0%24efbbdfe0%24%40nexbridge.com
In-Reply-To: <xmqqk0m0brq1.fsf@gitster.g>

```
On July 8, 2021 2:12 PM, Junio C Hamano wrote:
>"Randall S. Becker" <rsbecker@nexbridge.com> writes:
>
>> I am wondering whether there is, or are plans for, something analogous
>> to [includeIf "worktree:path"] with a similar semantic to [includeIf
>> "gitdir:path"].
>
>I do not think there currently is an implementation, nor a plan, but I offhand do not see downsides in a feature to let you
conditionally
>enable some configuration based on the location of the worktree.

Thanks. I'll start digging into this.


```

## Randall S. Becker, 2021-07-09 22:37

Subject: RE: [Question] worktree vs. gitdir in [includeIf]
Message-ID: <009d01d77513$07b638d0$1722aa70$@nexbridge.com>
URL: https://gitlist.dev/e/009d01d77513%2407b638d0%241722aa70%24%40nexbridge.com
In-Reply-To: <xmqqk0m0brq1.fsf@gitster.g>

```
On July 8, 2021 2:12 PM, Junio C Hamano wrote:
>To: Randall S. Becker <rsbecker@nexbridge.com>
>Cc: git@vger.kernel.org
>Subject: Re: [Question] worktree vs. gitdir in [includeIf]
>
>"Randall S. Becker" <rsbecker@nexbridge.com> writes:
>
>> I am wondering whether there is, or are plans for, something analogous
>> to [includeIf "worktree:path"] with a similar semantic to [includeIf
>> "gitdir:path"].
>
>I do not think there currently is an implementation, nor a plan, but I offhand do not see downsides in a feature to let you
conditionally
>enable some configuration based on the location of the worktree.

I'm scratching my head on this a bit. The [includeIf "onbranch:foo"] form is a bit confusing when dealing with a worktree. It looks
like the code either does not work if in a worktree or will get the branch of the main repo instead of the worktree ref. It looks
like include_by_branch() always returns 0 if in a worktree. Is there something being done in skip_prefix() or resolve_ref_unsafe()
that would deal with this?

Thanks,
Randall


```

## Randall S. Becker, 2021-07-12 22:22

Subject: RE: [Question] worktree vs. gitdir in [includeIf]
Message-ID: <013601d7776c$65f901b0$31eb0510$@nexbridge.com>
URL: https://gitlist.dev/e/013601d7776c%2465f901b0%2431eb0510%24%40nexbridge.com
In-Reply-To: <xmqqk0m0brq1.fsf@gitster.g>

```
On July 8, 2021 2:12 PM,  Junio C Hamano wrote:
>Subject: Re: [Question] worktree vs. gitdir in [includeIf]
>"Randall S. Becker" <rsbecker@nexbridge.com> writes:
>
>> I am wondering whether there is, or are plans for, something analogous
>> to [includeIf "worktree:path"] with a similar semantic to [includeIf
>> "gitdir:path"].
>
>I do not think there currently is an implementation, nor a plan, but I offhand do not see downsides in a feature to let you
conditionally
>enable some configuration based on the location of the worktree.

I have a patch set available, but am having some issues convincing the combination of git, OpenSSL, and my ISP to talk to each
other. Specifically, I'm getting "ssl3_get_record:wrong version number", on every system I'm using. Probably an operator error. I
might have to manually post the patch files.


```
