Repository navigation
fix(server): generate PR diffs from the merge base - #618
Merged
Merged
Conversation
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.
When the PR base advances independently, a two-dot tree diff includes reversed base-only changes in the context sent to
generatePrContent. A stale or missing local base can also inflate the context or fail despite an available tracking branch.Generate stat and patch from a single explicitly resolved common ancestor, while retaining two-dot commit-log semantics. Reject histories with no common ancestor or multiple merge bases with actionable recovery guidance instead of generating misleading content. Invalid refs and other Git failures remain GitCommandErrors; existing truncation limits and markers are preserved.
For unqualified base branches, prefer an existing tracking ref from the intended repository (the head remote for same-repository PRs, origin for the existing fork workflow). Keep the PR target branch name unchanged and preserve explicit refs and local-only/custom base branches. This follows the merged upstream correction at pingdotgg/t3code#13170 and handles additional edge cases in Ryco.
Validation with pinned Bun 1.4.0 and
bun install --frozen-lockfile:git diff --checkpassed.Verification uses real Git in isolated temporary repositories; text generation and GitHub calls are faked. No dev server, browser session or live model-generated PR was exercised for this backend-only change, and full repository suites were not run. Tracking selection uses available conventional
refs/remotes/<remote>/<base>refs; it does not force a new fetch or add custom fetch-refspec destination mapping.The reported concurrent-destination worktree test flake was reproduced separately: both additions can fail with HEAD/index-lock errors. The same failure reproduced using only two concurrent
git worktree addprocesses, without Ryco or PR range handling. This independent pre-existing issue remains; no worktree implementation or test semantics are changed here.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.