Skip to content

The '--dotfiles' option does not work as expected in conjunction with tree folding #120

@MalbrottsAsnan

Description

@MalbrottsAsnan

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions