Skip to content

Add Git Log Overview mode#5799

Open
damiensawyer wants to merge 3 commits into
jesseduffield:masterfrom
damiensawyer:overview-mode
Open

Add Git Log Overview mode#5799
damiensawyer wants to merge 3 commits into
jesseduffield:masterfrom
damiensawyer:overview-mode

Conversation

@damiensawyer

@damiensawyer damiensawyer commented Jul 11, 2026

Copy link
Copy Markdown

Hi Jesse. I note and respect your comment that "This project does not accept pull requests".

I submit this anyway in the hope that might get through your gate. I personally think it's a useful feature.

PR Description

When a branch's history is full of individual, non-squashed commits, the commits panel gets stretched out vertically to the point that it's hard to see the bigger picture — when a branch was merged in, what merged where, and how the history is structured. This adds an overview mode (toggled with ~, also available from the log options menu) that condenses the list down to just the commits that carry that structural information, hiding everything else:

  • merge commits
  • commits pointed to by a local branch, remote branch, tag, or HEAD
  • rebase todo entries (so mid-rebase views still work)

The result is a vertically condensed view where you can see at a glance when and where branches were merged into the one you're looking at, without scrolling past dozens of intermediate commits to piece it together.

The git graph keeps exactly the same shape it has in the full log — lane positions and merge join lines don't shift when rows are hidden, since the graph is computed from the full commit list and only the relevant rows are rendered.

Selection handling: if the selected commit gets hidden when the mode is turned on, the selection jumps to the nearest visible commit above it and scrolls into view. Turning the mode back off returns to the original commit, as long as the selection wasn't moved while in overview mode.

Commit limit: overview mode disables the commit-limit/load-more heuristic, since the condensed list can be much shorter than the threshold that heuristic relies on.

UI feedback: while active, the mode shows in the information panel with a reset button, and the commits view's title/tab gets an (overview) suffix, so hidden commits are never mistaken for missing history.

Guarded commands: actions that depend on the selection's position in the real commit list (squash, fixup, edit, move up/down, reword, drop, amend, etc.) prompt to exit overview mode first — the same pattern used by filter mode — since "the commit below" on screen isn't the commit below in the real history while rows are hidden.

screenshot-2026-07-11_21-54-31 screenshot-2026-07-11_21-54-41

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (go generate ./...)
  • Code has been formatted (gofumpt, golangci-lint clean)
  • Tests have been added/updated (toggle_overview_mode, toggle_overview_mode_scrolls_selection_into_view integration tests; unit tests for filterCommitsForOverview and GetCommitListDisplayStrings with displayIndices)
  • Text is internationalised (all new strings added to pkg/i18n/english.go with named placeholders)
  • New UserConfig entry (Keybinding.Commits.ToggleOverviewMode) hot-reloads like other action keybindings — no special handling needed
  • Docs updated (docs-master/Config.md, schema-master/config.json, keybinding cheatsheets — all regenerated)
  • Read through the diff for mistakes

damiensawyer and others added 3 commits July 10, 2026 18:41
…f tips

In repos with many merged PR branches the commits panel is dominated
by run-of-the-mill commits, making it hard to see the shape of the
history. Overview mode (bound to `~`, also in the log menu) hides
every commit that is neither a merge commit nor pointed to by a local
or remote branch, a tag, or HEAD, leaving just the landmarks. Rebase
todo entries stay visible so mid-rebase views keep working.

The graph keeps exactly the shape it has in the full log: the model
keeps the full commit list next to the displayed subset, the graph's
pipe sets are computed from the full list, and only the displayed
rows are emitted. Lane positions and merge join lines therefore don't
change when rows are hidden.

When the mode is enabled while the selected commit is one that gets
hidden, the selection moves to the nearest commit above it that stays
visible and is scrolled into view, and disabling the mode jumps back
to the original commit, unless the selection was moved in the
meantime.

Enabling the mode also turns off the commit limit: the condensed list
can have far fewer rows than the load-more heuristic's threshold
(selection approaching the end of the list), so the heuristic might
never kick in.

While active, the mode is shown in the information section with a
reset button, and the commits view's title and tab label get an
"(overview)" suffix, so hidden rows can't be mistaken for missing
history and the mode can be cancelled from anywhere.

Commands that feed the selection's list position into the rebase
machinery (squash, fixup, edit, move up/down, reword, drop, amend,
and friends) prompt to exit the mode first, exactly like filter mode
does: with rows hidden, "the commit below" on screen is not the
commit below in the real history.
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.

1 participant