threads / discuss / 56078

[Question] worktree vs. gitdir in [includeIf]

Subject: [Question] worktree vs. gitdir in [includeIf]

## tl;dr

5 messages between Jul 8, 2021 and Jul 12, 2021.

replies: 4people: 2as markdown or json

Randall S. Becker· Jul 8, 2021, 17:25 UTC · lore
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· Jul 8, 2021, 18:11 UTC · re: Randall S. Becker · lore

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.

Thanks.
Randall S. Becker· Jul 8, 2021, 18:15 UTC · re: Junio C Hamano · lore

RE: [Question] worktree vs. gitdir in [includeIf]

On July 8, 2021 2:12 PM, Junio C Hamano wrote:
Show 7 quoted lines
>"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· Jul 9, 2021, 22:37 UTC · re: Junio C Hamano · lore

RE: [Question] worktree vs. gitdir in [includeIf]

On July 8, 2021 2:12 PM, Junio C Hamano wrote:
Show 11 quoted lines
>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· Jul 12, 2021, 22:22 UTC · re: Junio C Hamano · lore

RE: [Question] worktree vs. gitdir in [includeIf]

On July 8, 2021 2:12 PM,  Junio C Hamano wrote:
Show 8 quoted lines
>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.

← back to recent threads