Summary
opendotsync conflicts show <path> requires the relative dotfile path (e.g. .bashrc) but users naturally pass absolute paths or home-relative paths, all of which fail with a misleading error.
Observed Behaviour
opendotsync conflicts show ~/.bashrc # Error: IO error: no conflicts found
opendotsync conflicts show .bashrc # Error: IO error: no conflicts found (if no active conflict)
opendotsync conflicts show /home/test1/.bashrc # Error: IO error: no conflicts found
conflicts list shows the correct path to use, but the error message gives no hint.
Expected Behaviour
- Accept absolute paths and home-relative paths by stripping the home dir prefix before lookup.
- When no conflict exists for the given path, say so clearly:
No conflict stashed for '.bashrc'. Run 'conflicts list' to see active conflicts.
conflicts list with no active conflicts should suggest opendotsync pull to check for remote changes.
Implementation
In cmd_conflicts_show (src/sync.rs), normalize the path argument:
// Strip home dir prefix if present
let rel_path = if path.starts_with(home_dir) {
path.strip_prefix(home_dir)?.to_str()?
} else {
path.trim_start_matches('/')
};
Improve the error message from the generic IO error to a targeted SyncError::NoConflict(path) variant.
Affected Files
src/sync.rs — cmd_conflicts_show(), cmd_conflicts_accept_local(), cmd_conflicts_accept_remote()
src/sync.rs — add SyncError::NoConflict(String) variant
Summary
opendotsync conflicts show <path>requires the relative dotfile path (e.g..bashrc) but users naturally pass absolute paths or home-relative paths, all of which fail with a misleading error.Observed Behaviour
conflicts listshows the correct path to use, but the error message gives no hint.Expected Behaviour
No conflict stashed for '.bashrc'. Run 'conflicts list' to see active conflicts.conflicts listwith no active conflicts should suggestopendotsync pullto check for remote changes.Implementation
In
cmd_conflicts_show(src/sync.rs), normalize the path argument:Improve the error message from the generic IO error to a targeted
SyncError::NoConflict(path)variant.Affected Files
src/sync.rs—cmd_conflicts_show(),cmd_conflicts_accept_local(),cmd_conflicts_accept_remote()src/sync.rs— addSyncError::NoConflict(String)variant