Conversation
This change updates the Git dialogs to compare against the correct parent branch instead of always using the main branch. Specifically: - Replaces detect_main_branch with detect_parent_branch in several locations to determine the base for diffs and commit messages. - Introduces detect_fork_point to determine the point where the current branch diverged from its parent. - Uses the fork point when no parent branch is specified, ensuring accurate diffs even when the parent branch is not explicitly set. Fixes WAR-7378 Co-Authored-By: Oz <oz-agent@warp.dev>
|
I'm starting a first review of this pull request. You can follow along in the session on Warp. I completed the review and posted feedback on this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR changes the Git dialog diff, commit-message, and PR-base helpers to use a fork-point SHA for branch-specific changes and updates the related tech spec.
Concerns
detect_fork_pointonly excludesorigin/<current>as the branch's remote copy; branches tracking a different remote or differently named upstream can subtract their own upstream and collapse the fork point toHEAD, producing empty PR diffs/AI content.detect_parent_branch_with_contextranks all refs containing the fork point without measuring which branch tip is closest to that fork, sogh pr create --basecan target an unrelated branch that merely contains the same ancestor.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
|
||
| /// See the no-`local_fs` stub above for documentation. | ||
| #[cfg(feature = "local_fs")] | ||
| pub async fn detect_fork_point(repo_path: &Path) -> Result<Option<String>> { |
There was a problem hiding this comment.
Is there a way we can reduce the amount of times this is called? Maybe computed + stored alongside the parent branch?
There was a problem hiding this comment.
I think it's fine, cache seems complicated cuz a lot of things can invalidate the state and then we need to know when to re-compute. Also this is only computed for branches with no upstream.
Co-Authored-By: Oz <oz-agent@warp.dev>
…val and remove parent branch logic (warpdotdev#9238) ## Description This change updates the Git dialogs to compare against the correct parent branch instead of the previous broken detect_parent_branch Specifically, this PR: - Introduces `detect_fork_point` to determine the point where the current branch diverged from its parent. - Uses the fork point when no parent branch is specified, ensuring accurate diffs even when the parent branch is not explicitly set. Fixes [WAR-7378](https://linear.app/warpdotdev/issue/WAR-7378/fix-publish-and-pr-on-diverged-parent-branch-bug) ## Testing Tested manually by verifying that diffs and commit message generation now correctly use the fork point rather than main when working on stacked branches. ## Server API dependencies N/A ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Co-Authored-By: Oz <oz-agent@warp.dev> --------- Co-authored-by: Oz <oz-agent@warp.dev>
Description
This change updates the Git dialogs to compare against the correct parent branch instead of the previous broken detect_parent_branch
Specifically, this PR:
detect_fork_pointto determine the point where the current branch diverged from its parent.Fixes WAR-7378
Testing
Tested manually by verifying that diffs and commit message generation now correctly use the fork point rather than main when working on stacked branches.
Server API dependencies
N/A
Agent Mode
Co-Authored-By: Oz oz-agent@warp.dev