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

Implement the --orig command (#4) #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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

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

Successfully merging this pull request may close these issues.

3 participants