-
Notifications
You must be signed in to change notification settings - Fork 67
Open
Description
Description
includeDirs configuration does not support directory paths containing slashes. Only the last component (basename) is matched because gtr uses find -name internally.
Environment
- OS: macOS (Darwin 25.2.0)
- Git version: 2.52.0
- gtr version: 2.1.0
- Shell: zsh
Steps to Reproduce
-
Create
.gtrconfig:[copy] includeDirs = node_modules includeDirs = vendor/bundle includeDirs = tmp/prompts
-
Create directories:
mkdir -p vendor/bundle tmp/prompts
-
Run
git gtr new test-branch
Expected Behavior
All three directories should be copied:
node_modulesvendor/bundletmp/prompts
Actual Behavior
Only node_modules is copied. vendor/bundle and tmp/prompts are not copied.
==> Copying directories...
[OK] Copied directory node_modules
[OK] Copied 1 directories
Root Cause Analysis
gtr uses find -name to locate directories, which only matches the basename (last path component), not full paths:
$ find . -name "node_modules" # ✅ Finds ./node_modules
$ find . -name "vendor/bundle" # ❌ No results (path not supported)
$ find . -name "tmp/prompts" # ❌ No results (path not supported)Proposed Solutions
- Support
-pathoption: Usefind -path "*/$pattern"when the pattern contains a slash - Direct path check: If the pattern contains
/, check if the path exists directly instead of usingfind - Documentation: At minimum, document that only basenames are supported
Workaround
Currently, users must specify only the basename:
includeDirs = bundle # instead of vendor/bundle
includeDirs = prompts # instead of tmp/promptsHowever, this may cause unintended matches if multiple directories share the same basename.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels