fix(update): keep gitoxide's fetch report off stdout, name each submodule#78
Merged
Conversation
…dule `submod update` printed gitoxide's own CLI-shaped fetch report — the refspec mapping and a per-ref status line — straight to stdout, then a bare "Updated N submodule(s)" summary that never said which submodules were touched. The plumbing narration was the only per-submodule detail on stdout, and it is gitoxide's output, not ours. `simple_gix::get_progress` was writing the captured `out` buffer to this process's stdout unconditionally. It now returns the captured buffers and lets the caller decide. `fetch_repo` takes a `verbose` flag and routes the report to stderr when the caller asked for it, or when the fetch failed and it is the only detail explaining why — so the diagnostic is preserved, not discarded. stdout is left to carry submod's own output, which callers parse. `GitManager::update_submodule` now names each submodule unconditionally rather than only under --verbose, so a multi-submodule update reports what it did rather than just how many. Verbose is plumbed through `GixOperations` via a `with_verbose` builder so the ~35 existing single-argument `GixOperations::new` call sites in the test suite are untouched and stay quiet by default. test_update_command now asserts the submodule is named and that the refspec report does not reach stdout — the leak is what made the per-submodule line unassertable in the first place, and left the wide `||` disjunction that #62 P2 flagged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XocU6NjgZricrRWMLyLXDn
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
submod updateprinted gitoxide's own CLI-shaped fetch report straight to stdout:Two things wrong with that. The refspec mapping is
gix fetch's output, not ours — it is narration for someone running gitoxide directly, and it lands on the stream callers parse. And the only thing submod itself said was a bare count that never named which submodules it touched.That combination is what left
test_update_commandunable to assert anything but a number, which is where the wide||disjunction flagged in #62 P2 came from.Fix
simple_gix::get_progresswas writing its capturedoutbuffer to this process's stdout unconditionally. It now returns the captured buffers and lets the caller decide.fetch_repogained averboseflag and routes the report to stderr when the caller asked for it, or when the fetch failed and it is the only detail explaining why. The diagnostic is preserved rather than discarded — it just stops colliding with submod's output contract.GitManager::update_submodulenow names each submodule unconditionally instead of only under--verbose.Verbose reaches
GixOperationsthrough awith_verbosebuilder rather than a newnew()parameter, so the ~35 existing single-argumentGixOperations::newcall sites in the test suite are untouched and stay quiet by default.Behavior
Tests
test_update_commandnow asserts the submodule is named, the count is reported, and the refspec report does not reach stdout.569/569 passing locally,
cargo fmt --checkclean, no new clippy warnings (the singletoo_long_first_doc_paragraphwarning in the lib is pre-existing onmain— verified by stashing).🤖 Generated with Claude Code
https://claude.ai/code/session_01XocU6NjgZricrRWMLyLXDn