feat: add option to keep HEAD on left#80
Conversation
|
Nice feature 👍 |
|
There's still some glitch. I thought is was easier but working on it. |
|
Yeah for my first test it didn't work as expected. |
|
It's working well now for me. I added a demo above. please give it a try. |
|
Before: A checkout was treated as a swap: everything on head column traded places with everything on far left. The branch that was leftmost jumped to HEAD’s old column, so the whole column layout looked reshuffled. Now: We move column In your case above, blue and green branches should remain in the same order. |



Still work in progress
Summary of the issue
When displaying multiple branches, it's possible (for maintainers quite likely) that HEAD is not the most recent commit and the line representing the HEAD branch rendered somewhere in the middle of the branches.
Proposed solution
This PR adds a toggle setting show the HEAD branch always on the left. This allows easy identification of the HEAD branch by position. Since the position becomes stable, the HEAD branch will also maintain a stable color.
Setting:
git-graph.repository.commits.headOnLeft: boolean, default falseDemo
If the setting is active, the graph adjusts automatically when a different branch is checked out moving the checked out branch to the left (it's a big repo and my system is a bit slow).
Note
Implemented with help from Cursor Composer.