Repository navigation
Conversation
max-sixty
force-pushed
the
path-name
branch
10 times, most recently
from
January 2, 2026 16:15
4c630f6 to
0287a86
Compare
Renames hook template variables for clearer semantics: - `repo_root` → `repo_path` (absolute path to repository root) - `worktree` → `worktree_path` (absolute path to current worktree) - `main_worktree` → `repo` (repository directory name) Adds new `main_worktree_path` variable for the actual path to the default branch worktree, useful for sharing dependencies across worktrees. Deprecated variables continue to work but emit warnings with migration assistance: - Detects deprecated variables using minijinja's undeclared_variables() - Creates a `.new` migration file with replacements - Shows inline warning: "User config uses deprecated template variables: repo_root → repo_path, worktree → worktree_path" - Shows hint: "Wrote migrated config.toml.new; to apply: mv ..." Project config warnings only appear when in main worktree (where changes can be committed). Warnings are deduplicated per path per process. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Fix malformed template bug: check for closing `}}` BEFORE emitting replacement to prevent corrupted output - Add shell escaping to mv command paths using shell_escape::escape - Add `--` separator to mv command to prevent paths starting with `-` from being interpreted as flags - Handle migration file write errors gracefully with hint message instead of propagating error that would block config loading - Use distinct [TEST_CONFIG_NEW] placeholder for .new files in snapshots for better readability - Add test for malformed template preservation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Replace manual character-by-character parsing (~55 lines) with regex-based
approach (~13 lines) that:
- Handles both {{ }} and {% %} Jinja blocks
- Supports multiline blocks with (?s) dotall mode
- Preserves original formatting instead of normalizing whitespace
- Uses word boundaries to avoid false matches
Trade-off: regex moves from dev to prod dependency.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Windows paths with backslashes get quoted by shell_escape, so the filter needs to handle: 'C:\Users\...\test-config.toml' Update regex to match both forward/backward slashes and optional quotes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Instead of regex-matching Jinja blocks, reuse extract_template_strings() to get TOML string values, then do word-boundary replacement within them. This naturally excludes TOML keys like `worktree-path` since we only process string values, not keys. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
repo_root→repo_path,worktree→worktree_path,main_worktree→repo)main_worktree_pathvariable for the path to the default branch worktreeMotivation
The old variable names were confusing:
worktree— is it a path or a name?repo_root— repository root or main worktree?main_worktree— sounds like a path, but it's actually the repo nameThe new names use consistent conventions:
*_pathsuffix = absolute pathrepo= repository directory namemain_worktree_path= path to default branch worktree (for sharing dependencies)Deprecation behavior
When configs use deprecated variables:
Test plan
🤖 Generated with Claude Code