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
Howdy @max-sixty π β Really enjoying using wt. Your effort is much appreciated π I was on git gtr for about a year before I switched. Now I couldn't imagine going back because wt list makes juggling a dozen worktrees obvious
The pain point has been not having git gtr's config management β git gtr config:
# writes to .git/config β local to this checkout, private, always-trusted
git gtr config add gtr.hook.postCreate "pnpm install && ./hack/oneoff.sh"# --global writes to ~/.gitconfig β every repo
git gtr config add gtr.hook.postCreate "pnpm install" --global
# committed .gtrconfig β shared with the team, gated behind `git gtr trust`
git gtr config set gtr.copy.include "**/.env.example"
Prior art: reading the tea leaves
When it comes to configs in general, I am with you on being "very keen to keep them simple". That said this issue continues to come up, which suggests other folks are stubbing their toes like I am trying to do what git gtr makes obvious and clean
git gtr is a fairly popular runner (~1.7k stars, brew installs ~5% userbase). I cite it specifically because I noticed that it hasn't been in the conversation. The config model it uses at once robust/flexible and simple
Support local configΒ #1077 ("Support local config"): Closed. With the approach below the need for repo-specific
file proposed goes away while still being shared across all worktrees
Untracked wt.toml config files no longer workΒ #2818 ("Untracked wt.toml config files no longer work"): Closed. With the approach below the need for the uncommitted file goes away while still being shared across all worktrees
I thought about using both but adding [projects."github.com/owner/repo"] in my user config every time I use worktrunk with a new git repo is not pragmatic for my workflow
I am currently using .config/wt.toml and I nerd sniped myself here when trying to change that default path to wt.config.toml (not possible: .config/wt.toml is hard coded today).
RFC: worktrunk.config. prefixed values in git config
# local to this checkout β .git/config, uncommitted, private
wt config state worktrunk.config.hook.post-start "./hack/vendor.sh && pnpm install"# global β ~/.gitconfig
wt config state worktrunk.config.hook.post-start "pnpm install" --global
No new config source. It's git's existing surface, not a new file format. Precedence is git's own, which everyone already understands: .git/config (local) over ~/.gitconfig (global).
Trust stays coherent. Local config is authored by me in my own checkout β always trusted, same as today's user config. Committed hooks keep the approval prompt.
worktrunk.config.* prefix separates "state" from "config" we prefer the existing wt config state command with a conventionally prefixed key worktrunk.config.* to avoid introducing ambiguity for existing wt config state managed values
Fixes a footgun.WORKTRUNK_PROJECT_CONFIG_PATH resolves relative to CWD
NOT the worktree root β project_config_path() in src/git/repository/config.rs returns PathBuf::from(path) verbatim, while the default branch does root.join(".config").join("wt.toml"). A relative override silently no-ops from a subdirectory. Reading via git config is worktree-aware by construction.
imho this makes the .config/wt.toml and [projects.*] plumbing redundant (which strictly speaking simplifies the codebase around config management a fair amount), but that also requires releasing breaking changes, which are can often take on lives of their own.
Will 100% submit a PR for this if you think it's worth exploring. Thoughts?
Howdy @max-sixty π β Really enjoying using
wt. Your effort is much appreciated π I was ongit gtrfor about a year before I switched. Now I couldn't imagine going back becausewt listmakes juggling a dozen worktrees obviousThe pain point has been not having
git gtr's config management βgit gtr config:Prior art: reading the tea leaves
When it comes to configs in general, I am with you on being "very keen to keep them simple". That said this issue continues to come up, which suggests other folks are stubbing their toes like I am trying to do what
git gtrmakes obvious and cleangit gtris a fairly popular runner (~1.7k stars,brewinstalls ~5% userbase). I cite it specifically because I noticed that it hasn't been in the conversation. The config model it uses at once robust/flexible and simplewt.tomlΒ #650 ("Better config/hook ergonomicsβ¦") β Also resolved because.git/configis shared across worktreesfile proposed goes away while still being shared across all worktrees
wt.tomlconfig files no longer workΒ #2818 ("Untrackedwt.tomlconfig files no longer work"): Closed. With the approach below the need for the uncommitted file goes away while still being shared across all worktreesgit gtrleverages makes per-worktree config files obsolete which reduces complexity a fair amount πWhy not existing solutions
There are two existing solutions here:
~/.config/worktrunk/config.toml: per-project config overrides.config/wt.toml: per-repo or per-worktree config overridesI thought about using both but adding
[projects."github.com/owner/repo"]in my user config every time I useworktrunkwith a new git repo is not pragmatic for my workflowI am currently using
.config/wt.tomland I nerd sniped myself here when trying to change that default path towt.config.toml(not possible:.config/wt.tomlis hard coded today).RFC:
worktrunk.config.prefixed values ingit configWhy I think this still honors our shared value on being "very keen to keep
themconfigs simple":.git/config(local) over~/.gitconfig(global).worktrunk.config.*prefix separates "state" from "config" we prefer the existingwt config statecommand with a conventionally prefixed keyworktrunk.config.*to avoid introducing ambiguity for existingwt config statemanaged valuesincludeIffor free. The[projectsMatching "hasconfig:β¦"]ask in Better config/hook ergonomics when creating new branch with uncommittedwt.tomlΒ #650 is literally git's conditional includes β you inherit it at zero cost.WORKTRUNK_PROJECT_CONFIG_PATHresolves relative to CWDproject_config_path()insrc/git/repository/config.rsreturnsPathBuf::from(path)verbatim, while the default branch doesroot.join(".config").join("wt.toml"). A relative override silently no-ops from a subdirectory. Reading viagit configis worktree-aware by construction.imho this makes the
.config/wt.tomland[projects.*]plumbing redundant (which strictly speaking simplifies the codebase around config management a fair amount), but that also requires releasing breaking changes, which are can often take on lives of their own.Will 100% submit a PR for this if you think it's worth exploring. Thoughts?