-
Notifications
You must be signed in to change notification settings - Fork 581
Description
Is your feature request related to a problem?
When using chezmoi unmanaged to find dotfiles that should be added to the source state, the output includes many paths that are intentionally not managed:
- XDG data/state directories (
.local/share/,.local/state/) - Tool-managed environments (
.local/pipx/, virtual environments) - Application runtime state (
.config/gcloud/,.config/gh/) - Downloaded plugins/assets (
Spoons/,node_modules/)
These clutter the output and make it hard to spot files that actually need attention. Currently, there's no way to filter chezmoi unmanaged output without external tooling.
Describe the solution you'd like
A .chezmoiunmanagedignore file in the source directory that filters the output of chezmoi unmanaged. It would use the same gitignore-style patterns as .chezmoiignore.
Example .chezmoiunmanagedignore:
# XDG data directories (not config)
.local/share/
.local/state/
# Tool environments
.local/pipx/
# Runtime state
.config/gcloud/
.config/gh/
# Nested logs everywhere
**/logs/
Running chezmoi unmanaged would then exclude these paths from output.
Describe alternatives you've considered
-
Using
.chezmoiignore- This prevents files from being applied, not from appearing inunmanagedoutput. Different purpose. -
Global gitignore + external filtering - I implemented a wrapper that filters through both global gitignore and a custom ignore file. Works but requires shell-specific tooling.
-
Piping through grep - Manual and error-prone for complex patterns.
Additional context
I've implemented this as a fish shell wrapper that:
- Calls
chezmoi unmanaged - Filters output against a
.chezmoiunmanagedignorefile using gitignore patterns
This works well but feels like functionality that belongs in chezmoi itself, especially since it mirrors the existing .chezmoiignore pattern.
Related: #3608 (about empty directories in unmanaged output - different but complementary)