You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow overriding project identifier for hook approvals #761
The project identifier used in [projects."..."] for hook approvals is automatically derived from the remote URL. This works well for simple GitHub repos, but creates issues in several scenarios:
1. GitLab nested groups are truncated incorrectly
GitLab supports deeply nested group structures like team/domain/subdomain/project. The current parsing appears to truncate this, resulting in something like team/domain — which means multiple distinct repositories end up sharing the same project identifier.
This causes unexpected behavior: approving hooks for one project silently approves them for another unrelated project.
2. Reusing a repo for a different project
Sometimes a repository is repurposed for a new project (with its own branches). The hook approvals from the previous project shouldn't carry over automatically.
3. Moving a repo changes its identifier
If I move my local clone to a different directory or change the remote URL (e.g., switching from HTTPS to SSH, or migrating to a new GitLab instance), the project identifier changes and all approvals are lost.
4. Declaration order in config matters
With multiple projects, the ordering in ~/.config/worktrunk/config.toml becomes significant in ways that aren't obvious.
Proposed solution
Allow setting an explicit project identifier in the project config (.config/wt.toml):
[project]
id = "my-custom-project-id"
When present, this would override the auto-derived identifier for hook approvals.
Alternatives considered
Manually editing the user config to rename the [projects."..."] section — but this is fragile and likely to break when worktrunk re-derives the key.
the glab bug is bad, sorry, I will fix. The glab PR detection was marked experimental, but it's important this part is very robust.
on the proposal for project.id — I'd be a bit worried that it means that any project can claim to be a project that has an existing id? I realize it's not likely but — similarly to how the glab bug is bad — we should be really robust here
are folks really changing remotes that often?
we have wt hook approvals clear & wt hook approvals add so it's fairly quick to clear & add approvals...
Ok, I'm starting to understand your approach. I tend to think in terms of a generic ~/ config combined with project-specific ./ configs, but yeah, local config files are definitely harder to manage with worktrees (been there 🙄).
Personally, I like having fine-grained control over configuration while still having sensible defaults—hence my suggestion to allow customizing the id.
But honestly, now that the GitLab id detection is fixed (tested it and it works great, thanks!) the rest is mostly a matter of taste, so I'm all good 🙂
Activity
max-sixty commentedon Jan 20, 2026
the glab bug is bad, sorry, I will fix. The
glabPR detection was marked experimental, but it's important this part is very robust.on the proposal for
project.id— I'd be a bit worried that it means that any project can claim to be a project that has an existing id? I realize it's not likely but — similarly to how theglabbug is bad — we should be really robust hereare folks really changing remotes that often?
we have
wt hook approvals clear&wt hook approvals addso it's fairly quick to clear & add approvals...max-sixty commentedon Jan 20, 2026
(glab nesting fixed in #768)
dohzya commentedon Jan 21, 2026
Ok, I'm starting to understand your approach. I tend to think in terms of a generic ~/ config combined with project-specific ./ configs, but yeah, local config files are definitely harder to manage with worktrees (been there 🙄).
Personally, I like having fine-grained control over configuration while still having sensible defaults—hence my suggestion to allow customizing the id.
But honestly, now that the GitLab id detection is fixed (tested it and it works great, thanks!) the rest is mostly a matter of taste, so I'm all good 🙂