Choose the base ref used to compare the current branch - #14
Draft
felipeorlando wants to merge 1 commit into
Draft
felipeorlando wants to merge 1 commit into
felipeorlando wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
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.
Closes #6
The compare base is now selectable instead of hardcoded to the repository default. For stacked branches, release branches and worktrees started from another feature branch, the previous diff was simply wrong.
Rust (
src-tauri/src/fs.rs) — newCompareBase { name, spec },git_resolve_base(acceptsmain,feature/xororigin/main, preferring the remote copy like the old default-branch logic) andgit_compare_base, which returnsErr("Compare base \"x\" no longer exists")rather than falling through to another branch.git_range_context_fortakesbase: Option<&str>and builds three-dot<resolved base>...HEAD.git_diff_indexgainsbase,base_ref,base_error,ahead_of_base(renamed fromahead_of_default),branch_files,branch_additions,branch_deletions.Status views fall back to the repo default and report
base_error; PR generation does not fall back — a PR must never be retargeted silently.TypeScript —
compareBase.tspersists per folder keyed byprojectKey(cwd), so a worktree and its parent checkout keep separate bases; the repo default is stored as absence, so a repo that renames its default follows along.CompareBasePicker.tsxis modelled onBranchPickerbut only changes the compare ref — it never calls checkout.GitChangesPanelgains aCompareBarrenderingbranch → base ▾plus branch-level counts, with an amber fallback line whenbaseErroris set. PR generation uses the resolved base the UI is displaying, not the raw preference.The working-tree/index view, staging flags and
ahead/behindare untouched.Verification
npm run check(web and rust) — exit 0:tsc --noEmitcleancargo fmt --checkclean,clippy -D warningsno warnings,cargo test214 passed9 new Rust
#[test]s on real temp repos, including stackedmain → feature-a → feature-b, deleted-base error, deleted-base fallback withbase_error, per-base counts asserting the checkout is unchanged, and a three-dot test proving commits added to the base after the fork are excluded.Not done / not verified
CompareBarlayout and popover placement are unverified beyond types and unit tests.Session.worktreeCwdis marked unused and nothing records a start-from ref. (Start a new session in the main checkout or a selected/new worktree #2 would change this.)git_history_tips). The acceptance criteria cover changed files/counts, PR context and PR target only.