fix(chezmoiignore): use target paths so conditional ignores actually apply#16
Merged
Conversation
…apply chezmoi matches .chezmoiignore patterns against the target path, not the source filename. The conditional entries used source-style paths (dot_config/..., executable_ prefixes), so they silently matched nothing — e.g. .local/bin/devpod-linuxbrew-fetch and .config/xdg-desktop-portal/hyprland-portals.conf deployed on macOS despite their platform-specific ignore blocks. Convert all such entries to target-style paths. Behavior change: these files now actually get excluded on the non-matching platforms (they were leaking before). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Updates .chezmoiignore.tmpl to ensure conditional ignore patterns match chezmoi target paths (e.g., .config/..., .local/bin/...) rather than source-style filenames (dot_config/..., executable_...), so platform/profile-specific ignores actually take effect during apply.
Changes:
- Convert devpod-only ignore entry from source-style to target-style path.
- Convert macOS-only and Hyprland/omarchy-specific ignore entries from
dot_config/.../dot_local/...forms to.config/.../.local/...target paths. - Preserve existing already-correct top-level entries, globs, and work-only overrides ignores.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
chezmoi matches
.chezmoiignorepatterns against the target path, not the source filename. Most conditional entries used source-style paths (dot_config/...,executable_prefixes), so they matched nothing and were silently dead.Proof
.local/bin/devpod-linuxbrew-fetchand.config/xdg-desktop-portal/hyprland-portals.confwerechezmoi managed(and deployed) despite their platform-specific ignore blocks being active.Change
Converts all source-style ignore paths to target-style (
dot_config/x→.config/x, stripexecutable_, etc.). The already-correct top-level entries, globs, and theoverrides/bin/{claude,aifx}lines are untouched.Behavior change
These files now actually get excluded on the non-matching platforms (they were leaking before). No
chezmoi applywas run; removing already-deployed stragglers (e.g. viachezmoi apply) is left to the user.🤖 Generated with Claude Code