Repository navigation
Conversation
A failed Pull reported "git pull failed", tagged with a reason at best, so a dead SSH agent or a missing remote was named only by a code. Fetch failures already map authentication, network, missing-repository and reference-lock errors to fixed messages; pull now uses the same diagnoses and runs Git with LC_ALL=C so they match on any server locale. The reason tag is kept, raw Git output still never enters the error, and unrecognised failures keep the generic message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This focused fix changes production handling of Git authentication failures and potentially credential-bearing remote stderr while adding locale-dependent diagnosis behavior. Although the existing pull flow is largely preserved and redaction is tested, the sensitive-data and authentication implications warrant human review. You can add or adjust custom eligibility rules. Learn more. |
|
Note Written by Thanks for working on pull diagnostics. This changes the explanation of existing failures rather than repairing the failed pull, and right now we are only taking focused bug fixes from outside contributors under Read this first. Please keep the SSH-agent failure tracked in an issue and seek maintainer agreement on diagnostic changes before requesting reconsideration. |
Fixes the secondary bug in the maintainer triage of #11872:
GitVcsDriver.pullCurrentBranchreplaces Git's output withgit pull failed, soPermission denied (publickey)never reaches the UI. #12485 fixed the fetch half of that; this PR is the pull half, built the same way. Supersedes #14702, which was closed because it did not name the model and harness used.What Changed
pullCurrentBranchnow explains a failedgit pull --ff-onlywith the fixed diagnoses #12485 added for fetch. When Git's output matches a known case the detail says "Git could not authenticate with the remote…", "Git could not reach the remote…", "Git could not access the remote repository…" or the reference-lock message. Anything else keeps "git pull failed". Thereasontag from #8645 is kept as it is.Raw Git output still never enters the error; only the fixed messages do. To match them on any server,
git pullnow runs withLC_ALL=C, like the fetch path. The output cap guard for large fast-forwards (appendTruncationMarker) is unchanged.Two small changes to the shared diagnosis, both found in review: the network case now also recognises macOS and unroutable ssh wording (
Operation timed out,No route to host,Host is down), so an unreachable host on the main desktop platform is named; and the lock message says a lock "may be blocking Git" rather than "the fetch", since it now also covers pull'sindex.lock.Why
Julius's triage of #11872 lists this as a defect of its own: Pull replaces Git's stderr with
git pull failed, so when a desktop SSH remote loses its forwarded agent, thePermission denied (publickey)that explains the failure never reaches the UI. #12485 fixed the same defect for fetch; Pull was left on the generic message. Since #14702 was opened, #8645 added a reason tag, somainnow shows a code rather than nothing, but still not an explanation:mainGit command failed in GitVcsDriver.pullCurrentBranch.pull (<repo>): git pull failed (authentication_failed)Git command failed in GitVcsDriver.pullCurrentBranch.pull (<repo>): Git could not authenticate with the remote. Check Git credentials or SSH access on the server, then retry. (authentication_failed)The fix mirrors #12485: the same
LC_ALL=Chelper, the same fixed diagnoses, the same error shape, one call site, and no change to what Pull does or to any default. The agent-lifetime bug that #11872 is mainly about is a separate fix and stays open.UI Changes
The toast text changes as in the table above. Screenshots from #14702, taken before #8645 added the trailing reason tag (so today's "before" also ends in
(authentication_failed)):Before:
After:
These were captured against a Linux host over SSH in the state #11872 describes; see #14702 for that setup.
Verification
vp test run src/vcs/GitVcsDriverCore.test.tsfromapps/server: 144 passed. New, all with real Git:sshprints OpenSSH'sPermission denied (publickey)line only under the C locale, so the test also proves pull fixes the locale; the error has the authentication detail andreason: "authentication_failed", and a marker printed alongside never appears in the message;reason: "remote_unreachable";mainand the new tests kept, both new pull tests fail (expected 'git pull failed' to include 'could not access the remote repository',… to include 'could not authenticate'). With the fix but withoutLC_ALL=Con pull, the SSH test fails the same way.vp exec tsc --noEmit -p .inapps/server: exit 0.vp lintandvp fmt --checkon the two changed files: clean apart from two existing warnings on lines this PR does not touch.Not checked in this rebuild: a fresh in-app run and the Linux/Windows test runs; #14702 did both for the same call-site change.
Review notes not acted on, deliberately out of scope:
LC_ALL=Calso reaches hooks run during the pull (post-merge), as it already does for fetch; and background auto-pull still runs withoutGIT_TERMINAL_PROMPT=0.Models