Hello,
The behaviour of the '--dotfiles' option seems unexpected when stow folds subtrees containing 'dot-' prefixed files. It appears that tree folding takes precedence over '--dotfiles', which is unintuitive as we are explicitly requesting translation to a dotfile. I have created an issue on GitHub about this (
#120), but I didn't know if that was enough or if I needed to report it here as well.
Steps to reproduce:
$ tree -a ~
/home/user/
...
└── stow
└── stow-dir
└── pkg-dir
└── dot-file
$ cd ~/stow && stow --dotfiles stow-dir
Expected behaviour:
$ tree -a ~
/home/user/
...
├── pkg-dir
│ └── .file -> ../stow/stow-dir/pkg-dir/dot-file
└── stow
└── stow-dir
└── pkg-dir
└── dot-file
Actual behaviour:
$ tree -a ~
/home/user/
...
├── pkg-dir -> stow/stow-dir/pkg-dir
└── stow
└── stow-dir
└── pkg-dir
└── dot-file
Would it be possible to modify the implementation of '--dotfiles' or introduce an option to control this behaviour? While a workaround is to use '--no-folding', it is not ideal since you lose a lot of functionality. Another workaround is to manually create the 'pkg-dir' prior to stowing, which would then also result in the expected behaviour shown above.
Additionally, if this new behaviour is to be implemented, I'm assuming it would be impossible/out of scope to have 'pkg-dir' removed when unstowing with 'stow -D stow-dir'. This means that stow will leave empty directories after itself even when it "owns" everything, which I understand may not align with design guidelines. Should it be implemented however, a note in the '--dotfiles' documentation warning about this would likely also be needed.
Best regards,
Hannes