Skip to content

Conversation

H3mul
Copy link

@H3mul H3mul commented Jun 1, 2021

Implemented the simple version of the proposal for feature #4.

This should resolve simple file conflicts while stowing by moving them to an .orig copy in the file location and then symlinking the target to the stow.

Added bonus: when using --orig with an unstow, it restores those .orig files back, so stow + unstow should leave the host filesystem untouched. This has no effect on unstow file conflicts.

I didn't need the flexibility of supplying the extension as another arg, or copying the backups to a different dir (as described in a further comment), but I'll be happy to implement if that feature has more demand!

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 86.465% when pulling 6135993 on H3mul:feature-4-orig-command into 4ef5eca on aspiers:master.

@orel1
Copy link

orel1 commented Sep 14, 2021

Thanks for this! It would be really useful to have this ability to ignore conflicts, especially for people like me who manage their dotfiles with stow :-)

however, I would have 2 remarks:

  • Would it be possible to name this option --backup, instead of --orig? There are at least 2 good old unix tools (see cp and mv) that use this syntax and as the goal is the same it would probably be better to use the same naming.
  • In the same idea of following the way cp and mv work, we could use the ~ suffix instead of .orig for renaming files

@aspiers aspiers added this to the Release 2.5.0 milestone Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants