GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): keep branches whose names end in /HEAD by hearnadam · Pull Request #65904 · anomalyco/opencode

Conversation

@hearnadam

@hearnadam hearnadam commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #65586

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

VcsGit.branches previously filtered out remote default-branch aliases by dropping any ref ending in /HEAD, which also excluded real branches such as topic/HEAD and origin/topic/HEAD.

This updates the git for-each-ref format to %(refname:lstrip=2)%00%(symref) and excludes refs with a non-empty %(symref) instead of checking the /HEAD suffix. Symbolic refs like origin/HEAD remain excluded while direct refs ending in /HEAD stay listed and searchable, with existing ordering, search, and limit behavior unchanged.

How did you verify your code works?

Added a unit test in packages/core/test/vcs.test.ts covering local topic/HEAD, remote origin/topic/HEAD, and symbolic ref origin/HEAD across full listing, search, and limit queries.

  • bun run script/test.ts test/vcs.test.ts (42 pass, 0 fail)
  • bun run script/test.ts test/vcs.test.ts -t '/HEAD' --rerun-each 10 (10 pass, 0 fail)
  • bun typecheck in packages/core
  • bunx oxlint and bunx prettier --check on the touched files

Screenshots / recordings

N/A (no UI changes)

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hearnadam
fix(core): keep branches whose names end in /HEAD
a22178d
@github-actions github-actions Bot added the contributor label Nov 23, 2026
@hearnadam
hearnadam marked this pull request as ready for review November 23, 2026 22:29
opencodejr[bot]
opencodejr Bot reviewed Nov 23, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reproduced the bug on the base branch and confirmed this fixes it. I ran the issue's reproduction script against opencode serve from source in both checkouts. On the base, GET /api/vcs/branch?search=topic returned [] and the full list left out topic/HEAD and origin/topic/HEAD. With this PR, both branches are listed and searchable, limit still applies, and the symbolic origin/HEAD stays hidden. test/vcs.test.ts passes, and tsc -b for packages/core is clean.

The public API is unchanged: /api/vcs/branch keeps the same response shape and now includes these branches.

Checking %(symref) is the right way to tell the alias apart from real branches. I have no concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hearnadam
Merge branch 'dev' into vcs-head-branches
2e4f148
@hearnadam
hearnadam enabled auto-merge (squash) November 23, 2026 22:37
@hearnadam
hearnadam merged commit 6230d3b into anomalyco:dev Nov 23, 2026
10 checks passed

Uh oh!

There was an error while loading. Please reload this page.

beyondChang pushed a commit to beyondChang/opencode that referenced this pull request Nov 24, 2026
@hearnadam @beyondChang
fix(core): keep branches whose names end in /HEAD (anomalyco#65904)
ba3e7c2
@hearnadam
hearnadam deleted the vcs-head-branches branch November 24, 2026 21:02
@amrkmn amrkmn mentioned this pull request Nov 26, 2026
opencode 2.4.2 amrkmn/homebrew-tap#1260
Closed
1 task
This was referenced Nov 26, 2026
feat: opencode release v2.4.2 sprisa/opencode-server#97
Merged
Tool release: OpenCode 2 v2.4.2 (was v2.3.2) agent-sh/agnix#1894
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

vcs: branch lists omit valid names ending in /HEAD

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@hearnadam
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.