Skip to content

Quiet, threshold-gated pre-push checkpoint progress (supersedes #1684) - #1883

Open
gtrrz-victor wants to merge 5 commits into
mainfrom
feat/push-progress-quiet-v2
Open

Quiet, threshold-gated pre-push checkpoint progress (supersedes #1684)#1883
gtrrz-victor wants to merge 5 commits into
mainfrom
feat/push-progress-quiet-v2

Conversation

@gtrrz-victor

@gtrrz-victor gtrrz-victor commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/cli/trails/965

Problem / intent

Supersedes #1684 (builds on @SnowingFox's work — kept as co-author).

The pre-push checkpoint sync can sit for a while (fetch, replay, retry), so a slow push feels stuck. #1684 addressed this with phased progress + a session tree, but since then git-refs became the default checkpoint backend:

  1. The default path is now flushCheckpointRefsQueue (git-refs), which Add detailed checkpoint push progress during pre-push #1684's session-tree UX didn't cover — it emitted an unconditional [entire] Pushing N checkpoint ref(s)... line + dot spinner.
  2. Most git pushes are run by agents and CI, which never read that stderr — so progress there is pure terminal noise.

Principle: useful to a human at a terminal, silent for everyone else.

Approach

  • pushReporter (new): gated on interactive.ShouldStyle — a non-TTY / NO_COLOR / cygwin writer receives zero bytes. On a styled terminal it reveals a single in-place line after ~1s (sub-1s pushes stay silent).
  • Live transfer + count: the revealed line streams git's own --progress stats in real time, alongside the checkpoint count and elapsed:
    [entire] syncing 12 checkpoints… writing 40/47 objects (3s)
    [entire] pushed 12 checkpoints (4s)
    
  • Divergence recovery (batch push rejected non-fast-forward → per-ref fetch+replay+push) shows an advancing counter:
    [entire] syncing checkpoint 5/24 with remote… (18s)
    
  • Transfer detail → file logs (.entire/logs/, operational metadata only) on both backends regardless of TTY.
  • Legacy git-branch path also silenced for non-TTY; error / auth-hint lines always print.
  • Push semantics unchanged — display only, fast-forward-only, never blocks the push.

Result

Who / when Terminal output
Agent / CI / non-TTY / NO_COLOR nothing (detail still in .entire/logs/)
TTY, sub-1s push nothing
TTY, slow push live line (count + transfer + elapsed) → persistent pushed N
Divergence recovery syncing i/N with remote counter
Any error / auth hint always printed

Test plan

  • pushReporter: non-TTY/unstyled writes nothing; reveal → live detail → persistent summary; empty-summary clears; deterministic (no time.Sleep), race-clean
  • live git --progress streamer: chunk-split parsing
  • git-refs path: non-TTY emits no progress while refs land + queue drains
  • logGitProgress: file-logs on both backends, no terminal writes (real fd-capture guard)
  • git-branch path: non-TTY silent, error/hint lines still print
  • Cursor Bugbot + Copilot review comments addressed (session-tree trailer bug, ShouldStyle gating, test isolation, session-tree styling, duplicate transfer line, flaky test)
  • mise run fmt, lint (golangci-lint v2.11.3), full -race suite — CI green

🤖 Generated with Claude Code


Note

Low Risk
Display and logging only around existing push/sync paths; push semantics and error handling boundaries are explicitly preserved with new regression tests.

Overview
Reworks pre-push checkpoint progress so agents/CI see no stderr noise while interactive pushes get clearer, less chatty feedback. Push behavior (fast-forward-only, fail-soft) is unchanged.

git-refs path: Replaces the unconditional “Pushing N ref(s)…” banner and dot spinner with a pushReporter that writes nothing unless stderr is a TTY and the sync runs longer than ~2s, then shows one in-place line that clears on completion.

git-branch (v1) path: Routes phased “Pushing / Syncing / done” lines and the session-tree summary through pushProgressOutput() (TTY-only); warnings and hints (SSH auth, protected refs, sync failures) still go to os.Stderr unconditionally. fetchAndRebaseRefCommon can stream fetch/rebase sub-steps to the progress writer and reports cherry-pick progress via an optional callback on cherryPickOnto.

Git push plumbing: PushWithOptions adds --progress and splits stdout/stderr; callers parse stderr for human display (displayGitProgress) and always file-log transfer phases via logGitProgress (including when the terminal is gated off).

Tests lock in non-TTY silence, actionable errors still printing, and log-only progress capture.

Reviewed by Cursor Bugbot for commit 43605ba. Configure here.

Copilot AI review requested due to automatic review settings July 31, 2026 12:27

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 43605ba. Configure here.

Comment thread cmd/entire/cli/strategy/manual_commit_push.go Outdated
Comment thread cmd/entire/cli/strategy/manual_commit_push.go Outdated
Comment thread cmd/entire/cli/strategy/manual_commit_push_test.go
Comment thread cmd/entire/cli/strategy/push_progress.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refines pre-push checkpoint sync UX to be silent for non-interactive environments (agents/CI) while still providing threshold-gated, in-place progress feedback for humans on a TTY, and moves detailed git transfer progress into .entire/logs/ for debuggability.

Changes:

  • Introduces a TTY- and time-threshold-gated pushReporter for git-refs checkpoint pushes (no scrollback residue; zero bytes on non-TTY).
  • Reworks legacy git-branch progress output to be TTY-only while preserving unconditional actionable warnings/hints.
  • Captures/parses git push --progress stderr for file logging on both backends and selectively displays human-friendly transfer summaries on TTY.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
cmd/entire/cli/strategy/push_reporter.go Adds threshold-gated, in-place progress reporter (TTY-only) for pre-push checkpoint sync.
cmd/entire/cli/strategy/push_reporter_test.go Adds tests for reporter silence on non-TTY and reveal/clear behavior on TTY.
cmd/entire/cli/strategy/push_progress.go Adds parsing/formatting for session summaries and git transfer progress; adds file logging helper.
cmd/entire/cli/strategy/push_progress_test.go Adds tests for push summary parsing/tree formatting and git --progress parsing/logging behavior.
cmd/entire/cli/strategy/push_common.go Wires progress gating for legacy git-branch backend; adds file logging of git transfer progress.
cmd/entire/cli/strategy/push_common_test.go Updates tests to assert non-TTY silence while warnings still print; adds regression guard for file-logged progress.
cmd/entire/cli/strategy/metadata_reconcile.go Extends cherry-pick helper to optionally report replay progress (current/total).
cmd/entire/cli/strategy/manual_commit_push.go Wires git-refs queue flushing to pushReporter; adds session-summary printing on TTY.
cmd/entire/cli/strategy/manual_commit_push_test.go Adds non-TTY regression test ensuring git-refs queue push remains silent while still pushing refs.
cmd/entire/cli/strategy/common.go Updates cherry-pick helper call sites for the new optional progress callback parameter.
cmd/entire/cli/checkpoint/remote/git.go Splits git push stdout/stderr capture and always enables --progress for parsing/logging.

Comment thread cmd/entire/cli/strategy/manual_commit_push.go
Comment thread cmd/entire/cli/strategy/push_progress.go
Comment thread cmd/entire/cli/strategy/push_progress.go
Comment thread cmd/entire/cli/strategy/push_reporter_test.go Outdated
gtrrz-victor and others added 4 commits August 3, 2026 12:16
Rework of the pre-push checkpoint-sync progress UX so it is useful to a
human at a terminal but silent for the agents and CI that actually run
most `git push`es. Now that git-refs is the default checkpoint backend,
the old path printed an unconditional "[entire] Pushing N checkpoint
ref(s)..." line plus a dot spinner to stderr that nothing downstream reads.

- New pushReporter: presence-gated on IsTerminalWriter (non-TTY writes
  zero bytes), reveals a single in-place line only after a ~2s threshold,
  and clears it on completion (no scrollback residue).
- git-refs default path (flushCheckpointRefsQueue) rewired to the reporter;
  removed the now-dead startProgressDots.
- git --progress transfer detail routed to .entire/logs/ (operational
  metadata only) on BOTH backends, regardless of TTY.
- Legacy git-branch path also silenced for non-TTY; error/actionable-hint
  lines still print unconditionally on both paths.
- Push semantics unchanged (display only, fast-forward-only, never blocks
  the user's push).

Builds on and supersedes #1684.

Co-Authored-By: snowingfox <snowingfox@users.noreply.github.com>
Entire-Checkpoint: 01KYW08431VR6EKA854NP1A0SR
- session tree: drop trailer valueonly so Entire-Session prefix matches the parser (was bucketing all commits to 'unknown')
- gate progress ANSI on ShouldStyle, not IsTerminalWriter (respects NO_COLOR / TERM=cygwin)
- style the session tree against the real output writer instead of io.Discard
- dedupe the duplicate 'counting objects' line in displayGitProgress
- isolate git config in the new push tests (IsolateGitConfigEnv)
- make the reporter reveal test deterministic (kill CI flake)

Co-Authored-By: snowingfox <snowingfox@users.noreply.github.com>
Entire-Checkpoint: 01KZ3ER62N63BETRDA7QFR0F88
Reveal at ~1s and stream git's --progress transfer stats live into the
reporter line (counting/compressing/writing) alongside the checkpoint
count, ending with a persistent "pushed N checkpoints" summary. Non-TTY,
non-ShouldStyle, and sub-1s pushes stay silent.

Co-Authored-By: snowingfox <snowingfox@users.noreply.github.com>
The SSH-auth-failure path calls finish("") then prints its own error; with
the new persistent-summary finish this emitted a content-less '[entire]  (Ns)'
line. Clear the line instead when summary is empty.

Co-Authored-By: snowingfox <snowingfox@users.noreply.github.com>
@gtrrz-victor
gtrrz-victor force-pushed the feat/push-progress-quiet-v2 branch from 43605ba to 1611bd0 Compare August 3, 2026 10:21
…ync recovery

The per-ref recovery path (batch push rejected as non-fast-forward) is slow
— one fetch+replay+push per ref — and 'resolving N diverged checkpoint(s)'
was opaque. Show an advancing 'syncing checkpoint i/N with remote' counter so
the user can see progress.

Co-Authored-By: snowingfox <snowingfox@users.noreply.github.com>
Entire-Checkpoint: 01KZ3KBDTT8MKFZ4J9JZVXF8VS
@gtrrz-victor
gtrrz-victor marked this pull request as ready for review August 3, 2026 11:07
@gtrrz-victor
gtrrz-victor requested a review from a team as a code owner August 3, 2026 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants