Skip to content

Changes totals silently compare against master when origin/HEAD is missing #30058

Closed

Description

@zbynekwinkler

What happened

The desktop sidebar showed millions of added lines for a branch containing only a few thousand additions relative to its intended integration branch, develop.

Diagnosis

In version 0.1.5, resolveBaseBranchForNoUpstream in apps/server/src/vcs/GitVcsDriverCore.ts checks branch-specific comparison settings, then the remote's default branch, then falls back to main and master.

In the affected repository, origin/HEAD was missing and no branch-specific comparison override existed. T3 selected origin/master, although the intended base was origin/develop.

The displayed total exactly matched Git's additions against origin/master. Setting origin/HEAD to origin/develop and refreshing corrected it.

Please make the selected comparison base visible alongside the total, and consider exposing a repository-wide comparison-base setting.

Steps to reproduce

  1. Use a repository with divergent master and develop branches and corresponding remote-tracking refs.
  2. Check out a feature branch based on develop.
  3. Ensure origin/HEAD is absent and the feature branch has no T3 comparison-base override.
  4. Open the checkout in T3 Code and inspect the sidebar Changes total.
  5. Observe that it reflects comparison against master, rather than develop.

These conditions were confirmed in an existing repository; a standalone reproduction repository has not been created.

Version

0.1.5, confirmed for both desktop client and local server.

Environment

Linux x64; desktop app connected to a local server.

Evidence

Read-only Git comparisons reproduced the displayed inflated total against origin/master and the expected smaller total against origin/develop. Before the workaround, resolving refs/remotes/origin/HEAD failed because the symbolic ref was absent.

Related issues

#25578: inflated changes resolved by selecting Uncommitted; different cause. #17807: missing origin/HEAD affected worktree cleanup. #27657: configurable base for creating new worktrees; different operation.

Fix applied or workaround

git remote set-head origin develop

The user ran this command and confirmed that refreshing corrected the count. This changes the local remote-default reference shared by linked worktrees.

Filed by

Codex (GPT-6), via t3 triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions