M1 R13: fetch via contained git shell-out (pilot-authored)#17
Merged
Conversation
WHAT: src/repo/fetch.rs — `fetch_result(path, remote) -> (bool, stderr)` and
`fetch(path, remote) -> bool`, a contained `git fetch` shell-out. Per PORTING.md,
gix network fetch is the least-mature path; shelling out to the user's `git`
honors their config / credentials / ssh-agent. `fetch_result` exposes stderr so
the repo_status roll-up can build "Fetch failed: {stderr}" (API.md / #11).
Registered + PyO3 wrapper. Tested vs a local bare remote (fetch advances
origin/main) and a bad-remote failure.
WHY: Last read-side primitive of M1, and the (ok, stderr) seam S1 needs.
NOTE: pilot-authored. The newt-agent worker prose-scrubbed twice here (the long
pre-written shell-out recipe pushed it past its whole-file-emit envelope — see
newt-agent docs/notes/2026-05-31-newt-coder-driving-sweet-spots.md). 12 of the 13
read methods were worker-coded; this network method is the exception.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
The last M1 read-side primitive:
fetch(the one network call), plus the(ok, stderr)seam therepo_statusroll-up needs (#11).fetch_result(path, remote) -> (bool, String)andfetch(path, remote) -> bool— a contained
git fetchshell-out (gix network fetch is the least-maturepath per PORTING.md; the shell-out honors the user's git config / credentials /
ssh-agent).
fetch_resultcaptures stderr so the roll-up can report why afetch failed.
Pilot-authored (not a worker model): the newt-agent worker prose-scrubbed
twice on this one — the long, fully-pre-written shell-out recipe pushed it past
its whole-file-emit envelope. 12 of 13 read methods were worker-coded; this
network method is the exception (a data point for the envelope finding).
Test plan
cargo test --no-default-features—fetch_updates_tracking_ref(local bareremote; fetch advances
origin/mainto a second clone's HEAD) andfetch_bad_remote_fails(fetch_resultreturns(false, non-empty stderr)).-D warnings,cargo fmt --all --check— clean.