Skip to content

Commit b0b3cab

Browse files
committed
chore(run) Note subprocess issue with streaming
1 parent 1d70b07 commit b0b3cab

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/libvcs/_internal/run.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ def progress_cb(output: t.AnyStr, timestamp: datetime.datetime) -> None:
201201
sys.stdout.flush()
202202

203203
callback = progress_cb
204+
205+
# Note: When git detects that stderr is not a TTY (e.g., when piped),
206+
# it outputs progress with newlines instead of carriage returns.
207+
# This causes each progress update to appear on a new line.
208+
# To get proper single-line progress updates, git would need to be
209+
# connected to a pseudo-TTY, which would require significant changes
210+
# to how subprocess execution is handled.
211+
204212
while code is None:
205213
code = proc.poll()
206214

tests/_internal/test_run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ def test_no_callback_no_streaming(self, tmp_path: pathlib.Path) -> None:
291291
assert output.strip() == "Normal output"
292292

293293
def test_progress_callback_with_carriage_returns(
294-
self, tmp_path: pathlib.Path
294+
self,
295+
tmp_path: pathlib.Path,
295296
) -> None:
296297
"""Test handling of carriage returns in progress output."""
297298
captured_chunks: list[str] = []

0 commit comments

Comments
 (0)