Skip to content

Show difference between source and destination file #91

@stfnx

Description

@stfnx

Dotter version: 0.12.9

Some of my configuration files are using templates.
I know that they are generated to .dotter/cache and then copied to the target location.
This works fine.

But sometimes the target file changes. In this case I get the following error message:

[ERROR] Updating template "sublime-text/settings.json" -> "/home/stfnx/.config/sublime-text/Packages/User/Preferences.sublime-settings" but target contents were changed. Skipping.
[ERROR] Some files were skipped. To ignore errors and overwrite unexpected target files, use the --force flag.

This is totally understandable and the desired behavior.
But how am I supposed to get the changes in the target file back to my template?

I could do it manually using diff:

diff ~/dotfiles/.dotter/cache/sublime-text/settings.json ~/.config/sublime-text/Packages/User/Preferences.sublime-settings

Sure this does work but it is cumbersome and a lot to type.

When running dotter --help I can see a --diff-context-lines option.
This gave me the impression that there must be a diff option baked into dotter.
But I couldn't find it...

Does dotter have a diff option? If not, is it planned?
Is there an easier way to do it?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions