-
Notifications
You must be signed in to change notification settings - Fork 42
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
Dotfiles option doesn't work with directories #33
Comments
Thanks for the report! I didn't implement |
I got bitten by this one too when trying the new release
|
Definitely not noise, thanks a lot @bricewge for the extra debug! Unfortunately I'm now packing for a 2 week holiday so am unlikely to have time to look at this soon, but if anyone else can make headway in my absence that would be awesome :) |
Apologies for not replying to the earlier report. I will try to reproduce and I'll see if I can make any headway before @aspiers returns from vacation. |
I was able to reproduce, thanks all for the detailed info. I think we expand the stow directory too early on; my assumption when originally implementing this was that the |
In the mean time, I've been using
|
I have this same structure, one way that works is to keep ~/dotfiles at the root of $ HOME and this command works (@lhindir):
And yes, indeed there is a bug, because in my environment if I try to pass a target it returns this same message:
|
Unfortunately the dotfiles options is currently broken for directories, see aspiers/stow#33.
I just came across this bug. and read through this issue and #63. It's not a dealbreaker (at least not for my use case), but it would be nice to have this feature working. Is there any ETA for this fix? |
Also, stow -D --dotfiles does not seem to work at all, even when files do not contain any "dot-filename" replacements. We get the to: To echo NPastorale, this would be a great feature. Thanks! |
`stow` supports the `--dotfiles` option which causes files beginning with the prefix `dot-` in the stow directory to be symlinked with a literal period character instead. This avoids the need to have hidden files in the stow directory. Unfortunately, this option is not fully working for hidden directories (see aspiers/stow#33). Hence, packages containing hidden directories remain unchanged for now. Add a README file to help with remembering how the installation works for each package.
The recent addition of the `--dotfiles` option allows me to name the files in a way so that they are not hidden by the shell. However, as noted in the README, Stow does not yet support using this option with subdirectories (see <aspiers/stow#33>), so these have not been converted to use the `dot-*` names.
This attempts to fix this problem: #70
I have added some unit tests and the pull requests is building in the CI system. I'm using it locally now also and seems to work. |
It would have been lovely to have the limitations of the --dotfiles option in the manual published/released while waiting for the fix to be pushed out |
It's been more than a year the bug was reported and two months since a fix has been proposed, any updates on this? |
Indeed. Would love to see the fix get merged. 🙏 |
Came across the same issue today. Would highly appreciate if the fix got merged. Also I can help noticing that it has been almost a whole year since the last commit on the master branch. Does the dev team need any help maintaining this project? |
Just stumbled on this bug, would be nice if the fix got released. |
See aspiers/stow#33 Until it's resolved dirs can't use dot- prefix
Just hit this too. Any timeline for a fix? |
I got bitten by this one too when use I found that ensuring the I don't know why, but it works for me. I use the latest release |
It would be nice to have this fixed! |
FWIW I ended up switching to twpayne/chezmoi specifically because of this issue. It was a PIA; however it (Chezmoi) does handle things much better, especially secrets. |
This is blocked by aspiers/stow#33 I get the following error: stow: ERROR: stow_contents() called with non-directory path: .dotfiles/all/.config
The recent addition of the `--dotfiles` option allows me to name the files in a way so that they are not hidden by the shell. However, as noted in the README, Stow does not yet support using this option with subdirectories (see <aspiers/stow#33>), so these have not been converted to use the `dot-*` names.
Surprised to see (what seems to me) such a major issue still unresolved. I've just started playing with stow in order to manage files in my home directory and it looks like I'll either have to rename dot-* to .* or switch to a different solution. Both of which would be fairly annoying... |
I don't understand why this project isn't archived already tbh, I was in love with stow so much but the lack of maintenance force me to look another alternatives, I tried chezmoi and is completely awesome, you probably want to take a look to it. |
The |
It's directories that are the problem in my case. Mostly anyway. |
A real shame this still doesn’t work - any pull requests/forks that work for anyone? |
This project seems largely unmaintained. Consider instead: https://www.chezmoi.io/ |
Hm, I'm wondering whether this is the wrong channel to raise attention about this issue. I just sent an email to the bug-stow mailing list to make sure.
Thanks for the suggestion. According to https://www.chezmoi.io/comparison-table/, |
Thanks @niklaas for raising this on the mailing list.
|
Still having this bug :( |
turn out dot-config -> .config not actually working gh issues has been open for a while aspiers/stow#33
For now, please see the interim update and apology here: #70 (comment) TL;DR: this bug is fixed in the Proper communications to follow this weekend. |
@aspiers cheers mate, stow has always been perfect for me and while there could be bugs fixed or features added it does what it says on the tin and you never abandoned it. I'm thankful for that! |
Very excited to see progress on this issue. Hopefully this weekend I can finally remove the hidden directories in my dotfiles repository! |
I have now merged |
It was a nightmare to iron out all the details but I finally have the improved fix working locally, and I'm now documenting it. |
Stow walks the package and target tree hierarchies by using mutually recursive pairs of functions: - `stow_contents()` and `stow_node()` - `unstow_contents()` and `unstow_node()` As Stow runs its planning from the target directory (`plan_*()` both call `within_target_do()`), previously the parameters for these included: - `$target_subpath` (or `$target_subdir` in the `*_node()` functions): the relative path from the target top-level directory to the target subdirectory (initially `.` at the beginning of recursion). For example, this could be `dir1/subdir1/file1`. - `$source`: the relative path from the target _subdirectory_ (N.B. _not_ top-level directory) to the package subdirectory. For example, if the relative path to the Stow directory is `../stow`, this could be `../../../stow/pkg1/dir1/subdir1/file1`. This is used when stowing to construct a new link, or when unstowing to detect whether the link can be unstowed. Each time it descends into a further subdirectory of the target and package, it appends the new path segment onto both of these, and also prefixes `$source` with another `..`. When the `--dotfiles` parameter is enabled, it adjusts `$target_subdir`, performing the `dot-foo` => `.foo` adjustment on all segments of the path in one go. In this case, `$target_subpath` could be something like `.dir1/subdir1/file1`, and the corresponding `$source` could be something like `../../../stow/pkg1/dot-dir1/subdir1/file1`. However this doesn't leave an easy way to obtain the relative path from the target _top-level_ directory to the package subdirectory (i.e. `../stow/pkg1/dot-dir1/subdir1/file1`), which is needed for checking its existence and if necessary iterating over its contents. The current implementation solves this by including an extra `$level` parameter which tracks the recursion depth, and uses that to strip the right number of leading path segments off the front of `$source`. (In the above example, it would remove `../..`.) This implementation isn't the most elegant because: - It involves adding things to `$source` and then removing them again. - It performs the `dot-` => `.` adjustment on every path segment at each level, which is overkill, since when recursing down a level, only adjustment on the final subdirectory is required since the higher segments have already had any required adjustment. This in turn requires `adjust_dotfile` to be more complex than it needs to be. It also prevents a potential future where we might want Stow to optionally start iterating from within a subdirectory of the whole package install image / target tree, avoiding adjustment at higher levels and only doing it at the levels below the starting point. - It requires passing an extra `$level` parameter which can be automatically calculated simply by counting the number of slashes in `$target_subpath`. So change the `$source` recursion parameter to instead track the relative path from the top-level package directory to the package subdirectory or file being considered for (un)stowing, and rename it to avoid the ambiguity caused by the word "source". Also automatically calculate the depth simply by counting the number of slashes, and reconstruct `$source` when needed by combining the relative path to the Stow directory with the package name and `$target_subpath`. Closes #33.
v2.4.0 is released with this fix! See https://ftp.gnu.org/gnu/stow/ I'm just updating the website and preparing an announcement email. |
turn out dot-config -> .config not actually working gh issues has been open for a while aspiers/stow#33
Paging @jvkersch in case he has any insight.
I use
stow
to manage my dotfiles. If I am trying to stow my config for zathura, I runstow --dotfiles zathura
from~/dotfiles
, which containszathura/dot-config/zathura/zathurarc
. This outputs:stow: ERROR: stow_contents() called with non-directory path: dotfiles/zathura/.config
I have no problem if I change the path to
zathura/.config
. Furthermore,stow --dotfiles bash
works fine on the filebash/dot-bashrc
. It only fails with directories.I'll freely admit I know little of the internals here, so I'm sorry if I'm just misunderstanding how to use it. But the error message makes it seem like
stow
is converting the path before getting the path contents and stowing, when it should be getting the path contents, then converting the path, and finally stowing.Thanks for any insight you can provide.
The text was updated successfully, but these errors were encountered: