From 5f2aaf0a7316d3bc5a17efc325d82d296f24df7e Mon Sep 17 00:00:00 2001 From: zerone0x Date: Sun, 29 Mar 2026 15:27:36 +0800 Subject: [PATCH] fix: filter already-merged commits from PR range context When generating PR title and body, `readRangeContext` uses `git log --oneline baseBranch..HEAD` to collect commit summaries. On long-lived branches where previous PRs were squash-merged into the base branch, this range includes old commits whose patch content already exists upstream. The LLM then generates titles reflecting stale work. Adding `--cherry-pick --right-only` to the git log command tells git to skip commits whose patch-id matches a commit already reachable from the base branch. This ensures only genuinely new commits feed into PR content generation, so each PR gets a fresh title based on its own changes. Fixes #1487 Co-Authored-By: Claude Opus 4.6 --- apps/server/src/git/Layers/GitCore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/server/src/git/Layers/GitCore.ts b/apps/server/src/git/Layers/GitCore.ts index 64ed409508..cdc6cfab53 100644 --- a/apps/server/src/git/Layers/GitCore.ts +++ b/apps/server/src/git/Layers/GitCore.ts @@ -1374,7 +1374,7 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { runGitStdoutWithOptions( "GitCore.readRangeContext.log", cwd, - ["log", "--oneline", range], + ["log", "--oneline", "--cherry-pick", "--right-only", range], { maxOutputBytes: RANGE_COMMIT_SUMMARY_MAX_OUTPUT_BYTES, truncateOutputAtMaxBytes: true,