Skip to content

Feature request: .chezmoiunmanagedignore file to filter chezmoi unmanaged output #4813

@jkp

Description

@jkp

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

  1. Using .chezmoiignore - This prevents files from being applied, not from appearing in unmanaged output. Different purpose.

  2. 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.

  3. Piping through grep - Manual and error-prone for complex patterns.

Additional context

I've implemented this as a fish shell wrapper that:

  1. Calls chezmoi unmanaged
  2. Filters output against a .chezmoiunmanagedignore file 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions