Version: 4.4.2 (Homebrew) · macOS
Summary
Run from a git worktree, config resolution uses the shared git dir and reports the primary checkout's config path, while scanning correctly uses the worktree. The two disagree.
Repro
git worktree add --detach /tmp/wt <sha>
cd /tmp/wt
codemap config show
Actual
No config file found.
Run 'codemap config init' to create /path/to/PRIMARY/checkout/.codemap/config.json
…while codemap context from the same directory correctly reports /tmp/wt as the root.
Cause
Config resolution appears to use git rev-parse --git-common-dir, which is deliberately shared across worktrees, rather than --show-toplevel.
Impact
config show reports on a directory you are not in.
config init from a worktree would write into a different checkout — surprising, and potentially a dirty file in someone else's working tree.
- Scan and config disagree, so per-project excludes may or may not apply depending on which entry point you came through.
Suggested fix
Use git rev-parse --show-toplevel for config resolution so it matches the tree being scanned. If sharing config across worktrees is intentional, say so in config show's output and never write outside the current toplevel.
Version: 4.4.2 (Homebrew) · macOS
Summary
Run from a
git worktree, config resolution uses the shared git dir and reports the primary checkout's config path, while scanning correctly uses the worktree. The two disagree.Repro
Actual
…while
codemap contextfrom the same directory correctly reports/tmp/wtas the root.Cause
Config resolution appears to use
git rev-parse --git-common-dir, which is deliberately shared across worktrees, rather than--show-toplevel.Impact
config showreports on a directory you are not in.config initfrom a worktree would write into a different checkout — surprising, and potentially a dirty file in someone else's working tree.Suggested fix
Use
git rev-parse --show-toplevelfor config resolution so it matches the tree being scanned. If sharing config across worktrees is intentional, say so inconfig show's output and never write outside the current toplevel.