aspiers / stow

GNU Stow - mirror of savannah git repository occasionally with more bleeding-edge branches
http://www.gnu.org/s/stow/
GNU General Public License v3.0
589 stars 41 forks source link

Restow does not actually write between removing and creating #69

Open AlexAegis opened 4 years ago

AlexAegis commented 4 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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