Skip to content

correctness: validate WT_*_BASE config paths are absolute paths#26

Merged
guodong-sq merged 1 commit intoblock:mainfrom
bezhermoso:bezalel/path-resolution
Mar 9, 2026
Merged

correctness: validate WT_*_BASE config paths are absolute paths#26
guodong-sq merged 1 commit intoblock:mainfrom
bezhermoso:bezalel/path-resolution

Conversation

@bezhermoso
Copy link
Copy Markdown
Contributor

@bezhermoso bezhermoso commented Mar 6, 2026

Config path variables (WT_MAIN_REPO_ROOT, WT_WORKTREES_BASE, WT_IDEA_FILES_BASE) are now validated on every bin/wt-* invocation. Relative paths and glob characters are rejected with actionable error messages pointing to the config file or git config to fix.

This prevents subtle bugs where relative paths silently resolve against whatever CWD the script happens to run from, producing unpredictable worktree locations or metadata vault paths.

Globs could cause unexpected shell expansion in find/for loops.

Shell startup (source wt.sh) is never affected — validation only runs in bin/wt-* scripts. wt-context is exempt so users can fix bad config.

Validate instead of fix

To avoid making assumptions about relative paths that may produce surprising behavior under certain circumstances, we should just validate & make our expectations clear and leave it to the user to fix their config.

Config path variables (WT_MAIN_REPO_ROOT, WT_WORKTREES_BASE, WT_IDEA_FILES_BASE) are now validated on every bin/wt-* invocation.
Relative paths and glob characters are rejected with actionable error
messages pointing to the config file or git config to fix.

This prevents subtle bugs where relative paths silently resolve against whatever CWD the script happens to run from, producing unpredictable worktree locations or metadata vault paths.

Globs could cause unexpected shell expansion in find/for loops.

Shell startup (source wt.sh) is never affected — validation only runs
in bin/wt-* scripts. wt-context is exempt so users can fix bad config.
@guodong-sq guodong-sq merged commit 1830dee into block:main Mar 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants