Skip to content

UX: git subprocess output leaks to stdout during push/pull/status #3

Description

@piranhap

Summary

The GitHub backend shells out to git (clone, pull, push, fetch) and all subprocess output is printed directly to the user's terminal, mixed in with opendotsync's own output. This is noisy and confusing.

Example

test1@fedora:~$ opendotsync pull
From github.com:piranhap/opendotsynctest
 * branch            main       -> FETCH_HEAD
Already up to date.
Pulled version 4
Updated:
  .bashrc

The first three lines are raw git output. Users don't need to see them during normal operation.

Similarly opendotsync status emits:

From https://github.com/piranhap/opendotsynctest
 * branch            main       -> FETCH_HEAD
Already up to date.
Profile: default
...

Expected Behaviour

Git subprocess output should be suppressed by default. With --verbose it should be shown. Errors from git (non-zero exit) should still be captured and surfaced as opendotsync error messages.

Proposed Fix

In src/backend/github.rs, replace .status() with .output() for all git subprocess calls. Discard stdout/stderr on success. On failure, include captured stderr in the BackendError message.

// Before
Command::new("git").args([...]).status()?;

// After
let out = Command::new("git").args([...]).output()?;
if !out.status.success() {
    let stderr = String::from_utf8_lossy(&out.stderr);
    return Err(self.git_err(&format!("git ... failed: {}", stderr)));
}

The rclone backend has the same issue and should get the same treatment.

Affected Files

  • src/backend/github.rs — all Command::new("git") calls
  • src/backend/rclone.rs — all Command::new("rclone") calls

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingux

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions