Resolve PRBaseBranch for PR context collection using merge-base ancestry. Use when orchestrators or review workflows need the correct comparison base branch.
Deterministic branch-selection rules for PR context collection.
Use this skill when:
drmCopilotExtension.collectPrContext,PRBaseBranch,PRBaseBranch MUST be resolved from git ancestry, not guessed.
Definition of correct base:
HEAD has the most recent commit timestamp,Run the following via Bash:
HEAD and detached refs.BM = git merge-base HEAD Bmerge_base_epoch(B) from git show -s --format=%ct M.merge_base_epoch(B).developmentmainmastermain unless merge-base resolution fails for all candidates.PRBaseBranch in orchestration state and reuse it within the same run.When invoking PR context collection, pass the resolved base explicitly:
drmCopilotExtension.collectPrContext --base <resolved-PRBaseBranch>
For auditability, include in logs/checkpoint: