Buffer partial lines in sessionStderr until a terminator arrives

main

Commit

Soph4mo ago

prefixedLineWriter inside internal/gitproto writes a sideband progress line in two Write calls — first the "source: " or "target: " prefix, then the content with its '\r' or '\n' terminator. sessionStderr was treating each Write as its own logical line, so verbose runs printed the prefix on a row by itself, then the content on the next row, instead of "source: Counting objects: 10%" on a single row.

Buffer partial-line input in a strings.Builder per writer instance and only flush on a terminator. The prefix lands in the buffer, the chunk's terminator triggers one combined notify("source: Counting objects: 10%"). Switch the type to use pointer receivers since each writer now carries state, and update construction sites in newSession to pass &sessionStderr{...} for the slog handler and both Conn.ProgressOut hooks.

Entire-Checkpoint: aabc1d4bcd1f

Checkpoints

can you rebase soph/progress-indicators onto soph/smart-subdivision

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1