Skip to content
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

Restow does not actually write between removing and creating #69

Open
AlexAegis opened this issue Apr 4, 2020 · 4 comments
Open

Restow does not actually write between removing and creating #69

AlexAegis opened this issue Apr 4, 2020 · 4 comments

Comments

@AlexAegis
Copy link

Or at least that's what I suspect because after using stow with -R the last modified date of the links does not change. Whereas if I run a -D and an -S after eachother it does (because then it really removes and adds it back).

And because the help page claims -R is like an -S after a -D but this proves otherwise

The only other flags I'm using is -d and -t

@aspiers aspiers added the bug label Apr 4, 2021
@aspiers
Copy link
Owner

aspiers commented Apr 4, 2021

Good catch. To be fair, it says -R is like -S after a -D, not that it's identical ;-)

Out of curiosity, does this lack of change to the links' timestamps cause a problem for you? And if so, how? I could look at changing the behaviour, but don't want to do that until I understand the use case.

@AlexAegis
Copy link
Author

AlexAegis commented Apr 12, 2021

I just use an -S after a -D in my script now, and even if this change would be implemented I would still do so, because since then I added an option to not put the symlink back so the complexity of my script wouldn't change.

	stow -D -d "$1" -t "$2" "$3"
			[ "$stow_mode" = "stow" ] && \
				stow -S -d "$1" -t "$2" "$3"

My script handles dotfiles and I wanted to still be able to watch filechange events on the symlinks, triggered by my script on "restow"

So to boil it down, based on the description of the -R flag I would expect a filechange event, because it is like an -S followed by a -D 😉.

I wouldn't say it's super important, even just removing that "like" statement from the flags description would be a solution as that would remove this expectation. Or just clarify that it does not touch files that wouldn't change. (I think thats what it does now)

@aspiers
Copy link
Owner

aspiers commented Apr 14, 2021

Yeah good points thanks. I'm just wondering if there is actually an advantage to keeping it with this different behaviour, because then (assuming we clarified the difference in the docs) users could choose which of the two behaviours they want. What do you think?

@AlexAegis
Copy link
Author

Tbh, at this point I'm not even sure whats the difference between -R and just running -S again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants