-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not list empty directories and directories with only ignored files/subdirectories in unmanaged
output
#3608
Comments
I think that this would be worthwhile, but it will take some time to consider how to approach the solution. Chezmoi uses twpayne/go-vfs, which is modelled after Go's own path.fs.Walk, which processes each directory entry in turn, and if the entry is itself a directory entry, processes the children of the directory. The processing is a closure passed to the This approach is very simple to implement, but means that:
The former could be fixed by visiting the children of directories first, but the second prevents that from being useful — and it has the unintuitive result of making the output look like:
instead of the somewhat more intuitive
Because chezmoi keeps state about what it does know about, there is probably something that could be done, but it's not clear to me exactly what could be done (I'm not that familiar with how those parts of chezmoi interact…yet). |
Is your feature request related to a problem? Please describe.
chezmoi unmanaged
inlcudes empty directories and directories with only ignored files or subdirectories in its output. This makes it harder to tell if there are files left that should be added to chezmoi.For example, the directory
~/.config/dconf
usually only contains a single file,user
, but if I add an ignore entry to chezmoiignorechezmoi unmanaged
still lists.config/dconf
as unmanaged.Describe the solution you'd like
chezmoi unmanaged
should not include these "empty" directories in its output.Describe alternatives you've considered
It is possible to ignore the whole directory, for example,
but in this case, I would not notice if dconf adds another file to its directory that I might want to add to chezmoi.
The text was updated successfully, but these errors were encountered: