Skip to content

fix(chezmoiignore): use target paths so conditional ignores actually apply#16

Merged
tyvsmith merged 1 commit into
mainfrom
fix/chezmoiignore-target-paths
Jun 27, 2026
Merged

fix(chezmoiignore): use target paths so conditional ignores actually apply#16
tyvsmith merged 1 commit into
mainfrom
fix/chezmoiignore-target-paths

Conversation

@tyvsmith

Copy link
Copy Markdown
Owner

What

chezmoi matches .chezmoiignore patterns 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

  • Docs: patterns "are matched ... against the target path, not the source path."
  • On macOS, .local/bin/devpod-linuxbrew-fetch and .config/xdg-desktop-portal/hyprland-portals.conf were chezmoi 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, strip executable_, etc.). The already-correct top-level entries, globs, and the overrides/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 apply was run; removing already-deployed stragglers (e.g. via chezmoi apply) is left to the user.

🤖 Generated with Claude Code

…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>
Copilot AI review requested due to automatic review settings June 27, 2026 03:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tyvsmith tyvsmith merged commit 177d4d5 into main Jun 27, 2026
2 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