Documentation
¶
Overview ¶
Package detect provides automatic parent branch detection for untracked branches.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Confidence ¶
type Confidence int
Confidence represents how certain the detection is.
const ( // Ambiguous means multiple candidates tied or no signal was found. Ambiguous Confidence = iota // Medium means a unique merge-base winner was found. Medium // High means a PR base branch matched a tracked branch or trunk. High )
func (Confidence) String ¶
func (c Confidence) String() string
String returns a human-readable confidence label.
type Result ¶
type Result struct {
Parent string
Confidence Confidence
PRNumber int // non-zero if detected via PR
Candidates []string // populated when Ambiguous, for prompting
}
Result holds the outcome of a parent detection attempt.
func DetectParent ¶
func DetectParent(branch string, tracked []string, trunk string, g *git.Git, gh *github.Client) (*Result, error)
DetectParent detects the parent branch using PR data first, falling back to local merge-base analysis. The GitHub client may be nil, in which case only local detection is used.
func DetectParentLocal ¶
DetectParentLocal detects the parent branch using only local git data (no network). It computes merge-base distance between the untracked branch and each candidate (trunk + tracked branches), returning the closest unique match.
Click to show internal directories.
Click to hide internal directories.