mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
In date order, the branches panel lists a stack of branches alphabetically rather than from the top of the stack down. Rebasing a stack creates all of its commits within the same second, so all of its branch tips end up carrying the same committer date, and git sorts refs with equal committer dates by name. Sort each group of branches that share a committer date by ancestry instead, so that a branch comes before the branches it is based on. Branches that are not descended from one another keep the alphabetical order git gave them. Determining the ancestry takes one more for-each-ref call, and it only runs when there is a group to sort. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>