[PR #333] Fix: #328 Use BFS to collect all commits in walk_commits_to_base #412

Closed
opened 2026-03-02 04:13:33 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/git-ai-project/git-ai/pull/333

State: closed
Merged: Yes


The walk_commits_to_base function was only following parent(0), causing it to miss commits from merged branches when using git rebase --rebase-merges. This resulted in AI authorship being lost for side branch commits.

Changed from linear traversal (parent(0) only) to BFS (Breadth-First Search) that traverses all parents, ensuring merge commits' second parents are not missed.

Fixes #328

**Original Pull Request:** https://github.com/git-ai-project/git-ai/pull/333 **State:** closed **Merged:** Yes --- The walk_commits_to_base function was only following parent(0), causing it to miss commits from merged branches when using git rebase --rebase-merges. This resulted in AI authorship being lost for side branch commits. Changed from linear traversal (parent(0) only) to BFS (Breadth-First Search) that traverses all parents, ensuring merge commits' second parents are not missed. Fixes #328
kerem 2026-03-02 04:13:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/git-ai#412
No description provided.