Whenever I add empty directories, and I run chezmoi apply --verbose, chezmoi successfully ignoring giving diff for that directory so custom diff command like delta not error when trying to diff directories.
But, when I tried to remove file along with directory in the exact_dirs, then chezmoi giving error when I run chezmoi apply --verbose.
To reproduce
delete directory in source dot_config/exact_lvim/exact_plugin
exact_plugin folder also has files which I expect to be removed too
run chezmoi apply --verbose
error given because delta trying to diff directory
Expected behavior
diff.exclude: dirs also respected when trying to remove directories
Output of command with the --verbose --debug flag
$ chezmoi apply --verbose ~/.config/lvim --debug
2022-11-16T17:35:45+07:00 INF defaultPreApplyFunc actualEntryState={"ContentsSHA256":"64d59030d37cc292f918c941ba2e940c525122e2869fd4ba24a97fdba82633c9","Mode":420,"Type":"file","contents":"local surr_utils = require(\"nvim-surround.config\")\nlocal ts_util..."} lastWrittenEntryState={"ContentsSHA256":"64d59030d37cc292f918c941ba2e940c525122e2869fd4ba24a97fdba82633c9","Mode":420,"Type":"file"} targetEntryState={"ContentsSHA256":"64d59030d37cc292f918c941ba2e940c525122e2869fd4ba24a97fdba82633c9","Mode":420,"Type":"file","contents":"local surr_utils = require(\"nvim-surround.config\")\nlocal ts_util..."} targetRelPath=.config/lvim/after/ftplugin/markdown.lua
2022-11-16T17:35:45+07:00 INF Lstat component=system name=/home/latipun/.config/lvim/after/plugin
2022-11-16T17:35:45+07:00 INF Get bucket=entryState component=persistentState key=/home/latipun/.config/lvim/after/plugin value="{\n \"type\": \"dir\",\n \"mode\": 2147484141\n}\n"
2022-11-16T17:35:45+07:00 INF defaultPreApplyFunc actualEntryState={"ContentsSHA256":"","Mode":2147484141,"Type":"dir"} lastWrittenEntryState={"ContentsSHA256":"","Mode":2147484141,"Type":"dir"} targetEntryState={"ContentsSHA256":"","Mode":0,"Type":"remove"} targetRelPath=.config/lvim/after/plugin
error: Could not access '/home/latipun/.config/lvim/after/plugin/null'
2022-11-16T17:35:45+07:00 ERR Run error="exit status 1" args=["delta","--paging","never","/home/latipun/.config/lvim/after/plugin","/dev/null"] duration=43.041842ms exitCode=1 path=/usr/bin/delta systemTime=12.553 userTime=35.857
2022-11-16T17:35:45+07:00 ERR ReadFile error="read /home/latipun/.config/lvim/after/plugin: is a directory" component=system data= name=/home/latipun/.config/lvim/after/plugin size=0
chezmoi: exit status 1; read /home/latipun/.config/lvim/after/plugin: is a directory
Describe the bug
I have this following config in
~/.config/chezmoi/config.yaml
:Whenever I add empty directories, and I run
chezmoi apply --verbose
, chezmoi successfully ignoring giving diff for that directory so custom diff command like delta not error when trying to diff directories.But, when I tried to remove file along with directory in the
exact_dirs
, then chezmoi giving error when I runchezmoi apply --verbose
.To reproduce
dot_config/exact_lvim/exact_plugin
exact_plugin
folder also has files which I expect to be removed toochezmoi apply --verbose
Expected behavior
diff.exclude: dirs
also respected when trying to remove directoriesOutput of command with the
--verbose --debug
flag