Skip to content

Conversation

@YasinFaraji
Copy link
Contributor

Overview
Introduced a new core feature to trace the evolutionary path of a branch. This allows the UI to identify which parent branches (e.g., develop, main) the current branch originated from.

Key Changes
C++ (GitBranch): Added getBranchLineage(QString) method using libgit2's git_merge_base logic.
Ancestry Logic: Implemented a robust check to identify reachable local branches by comparing their OIDs with the calculated merge base.
QML Integration: Exposed the functionality via GitResult to ensure consistent error handling and data flow to the UI.
Resource Management: Ensured strict cleanup of git_reference and git_branch_iterator to prevent memory leaks.

@YasinFaraji YasinFaraji self-assigned this Jan 19, 2026
Comment on lines +9 to +26
id : root

function getBranchLineage(branchName) : var {
if (!branchName) {
console.warn("getBranchLineage: branchName is empty")
return []
}

var result = GitService.getBranchLineage(branchName)

if (result.success) {
// result.data contains the QVariantList we filled in C++
return result.data
} else {
console.error("Failed to get lineage:", result.message)
return []
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra functions

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants