Repository navigation
Conversation
Contributor
|
Thanks for the pull request, @d1mka112. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request. See CONTRIBUTING.md for details. |
ymichael
pushed a commit
that referenced
this pull request
Nov 16, 2026
## Human comments ## What was wrong `resolveMergeBaseBranch` in `plugins/git/host/git.ts` tried the local branch first for a short name such as `main`, and used `origin/main` only when no local branch existed. When an unused local `main` trails `origin/main`, the Diff tab and `bb git diff --target branch_committed` compared against the stale local ref. Commits that were already on the remote base then showed as branch changes (#7114). ## What changed - `plugins/git/host/git.ts`: for a short name, resolve both `<branch>` and `refs/remotes/origin/<branch>`. When both exist and differ, use `origin/<branch>` if the local branch is an ancestor of it (`git merge-base --is-ancestor`). Otherwise, use the local branch. A name that starts with `refs/` or `origin/` resolves as before. - `plugins/git/skills/git/SKILL.md`: describes the new resolution order and `refs/heads/<branch>` to always select the local branch. - `workspace-reads.test.ts`: a regression test for a local `main` that trails `origin/main`. Deviation from the closed #7115, which always preferred `origin/<branch>`: a local base branch that is ahead of or diverged from origin still wins. This keeps unpushed base commits in the base, and the existing test that expects the local `main` (ahead of origin) passes without changes. The cost is one extra `git rev-parse`, and one `merge-base --is-ancestor` only when both refs exist and differ. No wire change, no `HOST_DAEMON_PROTOCOL_VERSION` change, no CLI change. ## How you verified - Before the fix, the new test fails: `AssertionError: expected 'diff --git a/base.txt b/base.txt...' not to contain 'base.txt'`. - After the fix: `pnpm exec turbo run lint lint:type-aware typecheck test --filter=bb-plugin-bb--git` passes, 11 of 11 tasks, 35 test files, 281 tests. `oxfmt --check` passes on the changed files. Fixes #7114 > AGENT GENERATED
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.
Human comments
What was wrong
The Git plugin resolves a short merge base name against the local branch first. When that branch trails its remote tracking branch, the Diff tab includes unrelated changes between the two base refs. Reproduced in #7114.
What changed
Short branch names now prefer
origin/<branch>when available and fall back to the local branch. An explicitrefs/heads/<branch>retains local branch selection. Updated the Git skill and added a regression test covering both paths. No server/daemon wire contract changed.How you verified
mainshows only the feature commit; explicitrefs/heads/mainshows both commits.pnpm exec turbo run test --filter=bb-plugin-bb--git: 35 files, 277 tests passed. Vitest reported a sandboxspawn EPERMduring process-sweep teardown after the tests; Turbo reported success.pnpm exec turbo run typecheck --filter=bb-plugin-bb--git: passed.git diff --check: passed.Fixes #7114