Skip to contentSkip to conversation

worktree vs. gitdir in [includeIf]

Question Randall S. Becker 2 participants 5 messages Jul 8, 2021 – Jul 12, 2021

lore
Share & tools
lore
#0 lore raw

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.

#1 lore raw
Quoted 3 lines · Randall S. Becker

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.

#2 lore raw
Quoted 7 lines · Junio C Hamano
Quoted 3 lines · Randall S. Becker

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

Quoted 1 line

enable some configuration based on the location of the worktree.

Thanks. I'll start digging into this.

#3 lore raw
In reply to Junio C Hamano
Quoted 11 lines · Junio C Hamano

To: Randall S. Becker <[email protected]>
Cc: [email protected]
Subject: Re: [Question] worktree vs. gitdir in [includeIf]

Quoted 3 lines · Randall S. Becker

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

Quoted 1 line

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

#4 lore raw
In reply to Junio C Hamano
Quoted 8 lines · Junio C Hamano

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

Quoted 3 lines · Randall S. Becker

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

Quoted 1 line

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.