Skip to content

Choose the base ref used to compare the current branch #6

Description

@felipeorlando

Problem

MonoCode hardcodes the repository default branch as the comparison/PR base. git_range_context_for resolves the default branch and builds <base>...HEAD; the Changes UI and Create PR affordance do not let the user choose another parent/base.

This is wrong for stacked branches, release branches, and worktrees started from another feature branch.

Proposed behavior

  • Show the relationship explicitly as current branch → compare base.
  • Add a base-ref picker with the repository default as the initial value and local/remote branches as choices.
  • Use the selected base for branch-level changed files/counts, generated PR context, and PR target.
  • Preserve the existing working-tree/index view for staging and committing; selecting a branch base must not change checkout state.
  • Remember the choice per repository/worktree. A newly created worktree can default to its start-from ref when that metadata is available.

Use merge-base/three-dot semantics so the review shows work introduced by the current branch rather than unrelated changes made on the base since the branch forked.

Existing work checked

Acceptance criteria

  • The UI always makes the current branch and selected base visible.
  • Changing the base refreshes the branch diff without checking out either ref.
  • Generated PR title/body context and target use the same selected base.
  • Default-branch behavior remains unchanged until the user selects another base.
  • Invalid or deleted refs fall back clearly instead of silently comparing against a different branch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions