Stream sideband progress to stderr when -v is set

main

Commit

Soph5mo ago

Long replicate and sync runs against large repos were silent between bootstrap batch checkpoints because both the source upload-pack and the target receive-pack sideband progress channels were being discarded.

Changes in internal/gitproto:

  • push.go: sendReceivePack now takes a verbose flag and wires the sideband demuxer's Progress field to stderr (prefixed "target: ") when set. Added a prefixedLineWriter that splits on both '\n' and '\r' so in-place git progress updates ("Resolving deltas: 12%\r") remain readable when prefixed. progressSink returns nil for non-verbose so the demuxer allocates nothing on the hot path.
  • fetch.go / refs.go: RefService gains a Verbose field. When true, fetchToStoreV1/V2, fetchPackV1/V2, and buildV1UploadPackBody stop asking the source to suppress progress (drop the "no-progress" upload-request capability and the "no-progress" v2 fetch arg) and wire the sideband demuxer's Progress to stderr (prefixed "source: ").
  • syncer.go: newSession propagates cfg.Verbose to sourceService.Verbose right after constructing it. Target-side verbose already flowed through gitproto.NewPusher.

New tests:

  • TestPrefixedLineWriter covers line splitting on '\n' and '\r', mid-line writes that don't emit a trailing prefix, and empty writes.
  • TestProgressSinkNilWhenNotVerbose locks in the "no allocation when quiet" contract.

Existing private fetch tests updated to pass the new verbose parameter. Commit-graph fetches (FetchCommitGraph) pass verbose=false because they are short and not user-facing.

With -v, a replicate run now looks like:

source: Enumerating objects: 120000, done. source: Counting objects: 100% (120000/120000), done. source: Compressing objects: 37% (44400/120000) ... target: Resolving deltas: 58% (69600/120000) target: Updating references: 100% (61/61), done.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com Entire-Checkpoint: cdd8c35ae583

Checkpoints

can you review the changes in this branch

Claude CodeOpus 4.6[1m]
View session
Checkpoint 1