Skip to content

Surface git clone/fetch progress and review commencement on stderr - #29

Merged
richardthombs merged 3 commits into
mainfrom
copilot/add-feedback-for-git-clone
Mar 24, 2026
Merged

richardthombs merged 3 commits into
mainfrom
copilot/add-feedback-for-git-clone

Conversation

Copilot AI commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

Long-running git clone --mirror and git remote update operations ran silently, giving users no feedback. The PR review engine also started without any indication, leaving users wondering if the process had stalled.

Changes

  • internal/git/git.go: Added Stderr io.Writer field to ExecRunner. When set, git's stderr (clone/fetch progress lines) is tee'd via io.MultiWriter to both the caller's writer and the internal capture buffer, preserving error message content.

    // New constructor for stderr-forwarding runner
    func NewExecRunnerWithStderr(stderr io.Writer) Runner {
        return ExecRunner{Stderr: stderr}
    }
  • internal/git/mirror.go: Added --progress to all network-facing git operations to force git to emit full progress output even when stderr is not a TTY (which it isn't when piped via io.MultiWriter). Also replaced git remote update --prune with git fetch --all --prune --progress since git remote update does not support --progress.

  • cmd/prr/checkout_helpers.go: mirrorServiceFactory now accepts an io.Writer so commands can inject cmd.ErrOrStderr() at creation time.

  • cmd/prr/review.go: Passes cmd.ErrOrStderr() to the factory and emits [prr] starting PR review... to stderr before invoking the review engine.

  • cmd/prr/checkout.go, diff.go, pwd.go: Pass cmd.ErrOrStderr() to the factory consistently.

All feedback is written to stderr only — stdout piping for JSON/Markdown review output is unaffected.

Original prompt

This section details on the original issue you should resolve

<issue_title>Lack of feedback during long running git clone operations</issue_title>
<issue_description># Problem statement
Cloning large repositories in preparation for reviewing the first PR can take a very long time. If this is the user's first experience using PRR, then they are likely to Ctrl-C out rather than wait patiently for the (invisible) clone operation to complete.

It can also take a little while for the PR review copilot action to complete.

Requirements

  1. Some kind of feedback for the user while the clone is proceeding.
  2. Some kind of feedback that the PR review has commenced prior to handing off to Copilot.
  3. This feedback should not interfere with redirecting or piping stdout, as that is a common use-case for recording PR review output.

Suggested way forwards:

If possible redirect git command output to stderr so that users see the familiar git clone output. Send all progress feedback to stdout also.
</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…derr

Co-authored-by: richardthombs <1511599+richardthombs@users.noreply.github.com>
Copilot AI changed the title [WIP] Add user feedback during long running git clone operations Surface git clone/fetch progress and review commencement on stderr Mar 19, 2026
Copilot AI requested a review from richardthombs March 19, 2026 17:17

@richardthombs richardthombs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I see is the message

"Cloning into bare repository '/home/richard/.cache/prr/repos/azure-blackbird-blackbird.git'..."

There are none of the typical git clone progress messages updating throughout the cloning process.

…on non-TTY stderr

Co-authored-by: richardthombs <1511599+richardthombs@users.noreply.github.com>

Copilot AI commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor Author

All I see is the message

"Cloning into bare repository '/home/richard/.cache/prr/repos/azure-blackbird-blackbird.git'..."...

Fixed in commit 642c199. The issue was that git suppresses its animated progress lines ("Receiving objects: X%...") when it detects stderr is not a TTY — which it isn't when we pipe it through io.MultiWriter. Adding --progress to the git commands forces git to emit the full progress output regardless of TTY detection:

  • git clone --mirror --progress — full progress during initial clone
  • git fetch --all --prune --progress — full progress during mirror updates (also replaces git remote update --prune which lacks a --progress flag)
  • git fetch --progress <remote> <refspec> — progress during PR ref fetches

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/acme/repo/pulls/42
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha ne^{commit} 0.1-go1.25.0.lin--64 ux-amd64/pkg/tool/linux_amd64/cgo ame (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/42 --jq .base.ref,.base.sha ux-amd64/src/run--gdwarf-5 (http block)
  • https://api.github.com/repos/acme/repo/pulls/73
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha -g (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/73 --jq .base.ref,.base.sha ux-amd64/src/run-pthread 0.1-go1.25.0.lin-Wl,--no-gc-sections rg/toolchain@v0.-fmessage-length=0 ame (http block)
  • https://api.github.com/repos/acme/repo/pulls/77
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/acme/repo/pulls/77 --jq .base.ref,.base.sha ux-amd64/src/run--gdwarf-5 0.1-go1.25.0.lin--64 rg/toolchain@v0.-o s (http block)
  • https://api.github.com/repos/checkouttestuser/checkouttestrepo/pulls/987654321
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser/checkouttestrepo/pulls/987654321 --jq .base.ref,.base.sha -g -fno-stack-protector -ffile-prefix-map=/home/REDACTED/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.25.0.linux-amd64=/_/GOROOT -frandom-seed=ErwUOgZXGPQicNxXiONF -o /tmp/go-build3793202622/b184/_cgo_main.o -c (http block)
  • https://api.github.com/repos/checkouttestuser2/checkouttestrepo2/pulls/123456789
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha (http block)
    • Triggering command: /usr/bin/gh gh api repos/checkouttestuser2/checkouttestrepo2/pulls/123456789 --jq .base.ref,.base.sha ne^{commit} (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from richardthombs March 19, 2026 20:05
@richardthombs
richardthombs marked this pull request as ready for review March 24, 2026 14:26
@richardthombs
richardthombs merged commit 29ef285 into main Mar 24, 2026
3 checks passed
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.

Lack of feedback during long running git clone operations

2 participants