Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): preserve spaces in Git remote URLs #34324

Mergedvoltcrash(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/34324/headmerged by maria-rcks View on GitHub

Problem

With git remote add origin '/tmp/team repos/shared.git', Git lists the remote correctly, but T3 drops its fetch and push entries. ensureRemote then attempts to add origin again and fails because that name already exists. listRemotes also returns an empty list.

Change

Both VCS parsers now use Git's tab and direction separators to preserve the complete URL field. Fetch/push handling, CRLF and partial-clone annotations remain supported. The regression checks remote reuse, collision suffixing, distinct push URLs and preservation of the configured URLs, including leading/trailing whitespace and literal direction markers in paths.

Scope and approval

This qualifies as a very small, focused fix for an obvious bug: an existing remote disappears solely because its local path contains spaces. It changes the two VCS parsers responsible for that failure, without contracts, UI changes or parser consolidation. The other three verbose-remote parsers serve repository identity (which intentionally excludes local paths) and host-specific provider operations.

Credit to @yashranaway's earlier fix in #11390. It was closed unmerged with a maintainer request to rebuild on current main with a newer model. This fix was independently reproduced and rebuilt on current main, including the second VCS parser. #28769 leaves URL spaces unresolved and owns parser consolidation; #29625 addresses multiple configured URLs, a separate problem.

Verification

Linux ARM64, Git 2.56.0. New real-Git regressions before the fix: 4 failed, 1 passed (the existing HTTPS/SSH row). After the fix, the focused remote-operation and listing run: 29 passed.

A separate runtime program constructed the actual server Git services, created temporary repositories and real bare remotes under team repos, configured separate fetch/push URLs and a partial-clone filter, and called listRemotes and ensureRemote:

                                 Before                     After
listRemotes                      []                         origin, exact fetch/push URLs
ensureRemote(fetch URL)           GitCommandError (exit 3)   origin
ensureRemote(distinct push URL)   GitCommandError (exit 3)   origin-1

Git's final listing confirmed that origin retained both URLs and origin-1 used the requested URL. No client UI or Windows runtime verification was performed; this is a server parser fix.

vp run check:changed upstream/main: format, lint, both knip passes, generated GraphQL, typecheck of 3 affected packages and all 328 tests in the 3 affected test files passed. The branch was then cleanly rebased onto current main, with unchanged behavior diff and the server runtime reproduction passing again.

Reviewed with review-loop: 1 round with Claude Opus 5.5 on high. Reviewer verdict: approved. No blockers or should-fix findings; shared-parser consolidation remains with #28769.

Created with GPT-6.1 Sol in the Codex harness through T3 Code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 7729934

      Macroscope's review found this PR approvable — The change preserves spaces in Git remote URLs when listing and matching existing remotes. It leaves remote operations and configuration-write safeguards unchanged, with no obvious material risk requiring human judgment.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Explain Change →

      No actionable comments were generated in the recent review.

      Walkthrough

      The remote listing parsers now handle LF and CRLF output and preserve spaces in URLs. Tests cover remote URL parsing and remote selection.

      Changes: Git remote URL parsing

      Layer / File(s)Summary
      Parse and validate remote listings
      apps/server/src/vcs/GitVcsDriver.ts, apps/server/src/vcs/GitVcsDriverCore.ts, apps/server/src/vcs/GitVcsDriver.test.ts, apps/server/src/vcs/GitVcsDriverCore.test.ts
      Both parsers use Git’s tab-delimited remote format and support LF or CRLF output. Tests check URLs containing spaces and remote selection.

      Estimated code review effort: 2 (Simple) | ~10 minutes

      Change: Bug fix

      Possibly related PRs

      • pingdotgg/t3code#28769: Replaces the same remote parsers with a shared parseGitRemoteEntries implementation.

      Suggested reviewers: juliusmarminge

      Merge Risk: Minimal · up to 5fbcc

      This server-side fix keeps spaces in Git remote URLs, so listing remotes and reusing an existing remote name should work as intended. No merge-blocking risk remains.

      Pre-merge checks: Passed 4

      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: preserving spaces in Git remote URLs in the server.
      Description checkPassedThe description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, scope rationale, regression coverage, observed results, limitat…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description covers the required Problem, Change, Scope and approval, and Verification sections. It explains the bug, implementation, scope rationale, regression coverage, observed results, limitations, and review context.

      Finishing Touches

      Generate unit tests (beta)

      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Recent review info

      Run configuration

      Commits

      Reviewing files that changed from the base of the PR and between faa8ad681861430740c5adfc225540eaf3e46272 and 5fbccaef59ca203576d1a38114341f09f0099e1c.

      Files selected for processing: 4

      • apps/server/src/vcs/GitVcsDriver.test.ts
      • apps/server/src/vcs/GitVcsDriver.ts
      • apps/server/src/vcs/GitVcsDriverCore.test.ts
      • apps/server/src/vcs/GitVcsDriverCore.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

    4. Note

      Written by claude-opus-5-5 on behalf of Maria

      Verified in a real dev environment

      Linux, Git 2.43.0, vp run dev web client driven with Playwright + Chrome. Base github/main at d2c25950b4, PR head 5fbccaef59.

      Scenario: a clone of octocat/Hello-World (origin on GitHub) that also has a remote named prakashk7475-lgtm pointing at /home/user/scenario/team repos/prakashk7475-lgtm.git. In the app I added the folder as a project, typed #11724 (a fork PR from that owner) in the ref picker, chose Checkout pull request → Worktree, then sent a Claude Haiku 5.5 turn asking for git status -sb and git remote -v.

      main: the space-path remote is dropped by the parser, so ensureRemote tries git remote add prakashk7475-lgtm ... and fails:

      WARN GitManager.configurePullRequestHeadUpstream failed
        cause: { _tag: 'GitCommandError', operation: 'GitVcsDriver.ensureRemote.add', exitCode: 3 }
      $ git config branch.t3code/pr-11724/feature/my-first-change.remote
      (empty)

      The PR branch has no upstream, and the git panel offers "Push & create PR" for a PR that already exists.

      main: after checking out fork PR 11724 the git panel shows Push & create PR and no PR link

      main: Claude Haiku turn shows git status with no upstream and only the two original remotes

      PR: the existing remote is seen, the fork gets prakashk7475-lgtm-1, and the branch tracks it. No warning in the server log.

      $ git remote -v
      prakashk7475-lgtm    /home/user/scenario/team repos/prakashk7475-lgtm.git (fetch)
      prakashk7475-lgtm-1  https://github.com/prakashk7475-lgtm/Hello-World (fetch)
      $ git branch -vv
      + t3code/pr-11724/feature/my-first-change 253c119 [prakashk7475-lgtm-1/feature/my-first-change] ...

      The git panel shows the #11724 PR link and the thread row shows the PR badge.

      PR: after checking out fork PR 11724 the git panel links #11724 and offers Commit

      PR: Claude Haiku turn shows the branch tracking prakashk7475-lgtm-1 and the space-path remote kept intact

      Nearby behavior on the PR build:

      • GitHub provider detection from listRemotes still works: the ref picker offers "Checkout pull request" and the PR resolves.
      • Checking out the same PR again from a new thread reuses the worktree and prakashk7475-lgtm-1 (no -2 remote, no warnings).

      CI is green on 5fbccaef59.

      Not verified

      • Windows Git output (CRLF) in a running app; covered only by the PR's unit tests.
      • The publish-repository path (ensureRemote after creating a hosted repo), since it would create a real repository.
      • Partial-clone ([blob:none]) remotes in the running app.
    5. tanstack-source added labelsbug

    6. maria-rcks merged this1b42b16

    7. maria-rcks closed this

Sign in to join this conversation.