jesseduffield.lazygit/pkg/gui
Stefan Kerkmann 2ed887d149 Commits: add incremental git log limit
The existing git log logic fetched the first 300 commits of a repo and
displayed them in the local and sub-commit views. Once a user selected a
commit beyond a threshold of 200 commits the whole repository was
loaded. This is problematic with large repos e.g. the linux kernel with
currently ~138k commits as lazygit slows down substantially with such a
large number of commits in memory.

This commit replaces the current all or only the first 300 commits logic
with an incremental fetching approach:

1. The first 400 commits of repo are loaded by default.
2. If the user selects a commit beyond a threshold (current limit-100)
   the git log limit is increased by 400 if there are more commits
   available. If there are more commits available is currently checked
   by comparing the previous log limit with the real commit count in the
   model, if the commit count is less then the limit it is assumed that
   we reached the end of the commit log. Ideally it would be better to
   call `git rev-list --count xyz` in the right places and compare with
   this result, but this requires more changes.

Adding a "paginated implementation" by utilizing `git log --skip=x
--max-count=y` and appending commits to the model instead of replacing
the whole collection would be nice, but this requires deeper changes to
keep everything consistent.

Signed-off-by: Stefan Kerkmann <s.kerkmann@pengutronix.de>

Co-authored-by: DeepSeek V4 Flash
2026-09-02 16:08:50 +02:00
..
context Commits: add incremental git log limit 2026-09-02 16:08:50 +02:00
controllers Commits: add incremental git log limit 2026-09-02 16:08:50 +02:00
filetree Drop the menu-specific wording for the filter prompt 2026-08-31 20:41:22 +02:00
mergeconflicts Recognize conflict markers that have no label 2026-08-08 12:43:42 +02:00
modes Make Commit.Hash a getter for an unexported hash field 2025-04-29 14:57:15 +02:00
patch_exploring Rework the custom pager config (rename to diff renderer) 2026-07-31 08:42:51 +02:00
popup Decouple hiding the working tree state from blocking input 2026-08-05 17:29:20 +02:00
presentation Show a Github PR's combined checks state in branches list and main view 2026-08-02 13:06:21 +02:00
services/custom_commands Remove the RefreshMode field 2026-07-17 12:32:32 +02:00
status Render the app status in a single background render loop 2026-07-17 15:55:01 +02:00
style Modernize all codes 2025-11-15 10:46:23 +01:00
types Drop the menu-specific wording for the filter prompt 2026-08-31 20:41:22 +02:00
background.go Let OnUIThreadAndWait's error be about the wait, not about f 2026-08-12 11:04:53 +02:00
command_log_panel.go Adapt links 2026-07-31 08:42:51 +02:00
context.go Filter a menu by typing into it 2026-08-31 20:41:22 +02:00
context_config.go Remove some unused code 2025-07-08 15:14:45 +02:00
controllers.go Keep a filtering menu navigable whatever the keybindings are 2026-08-31 20:41:22 +02:00
dummies.go Move NewDummyCommon to pkg/common 2025-05-06 09:43:26 +02:00
editors.go Filter a menu by typing into it 2026-08-31 20:41:22 +02:00
extras_panel.go Rename Key to Keys in Binding, KeybindingsOpts, and MenuItem 2026-05-25 15:18:18 +02:00
global_handlers.go Read lines based on scroll position instead of a fixed per-notch delta 2026-07-09 09:32:35 +02:00
gui.go Filter a menu by typing into it 2026-08-31 20:41:22 +02:00
gui_common.go Remove error return value from functions that always return nil 2026-08-31 20:41:22 +02:00
gui_driver.go Add test helpers for a menu's filter row 2026-08-31 20:41:22 +02:00
information_panel.go Rename ModeStatus.Description to InfoLabel 2025-08-14 17:59:38 +02:00
keybindings.go Remove error return value from functions that always return nil 2026-08-31 20:41:22 +02:00
layout.go Filter a menu by typing into it 2026-08-31 20:41:22 +02:00
layout_test.go Lay out the filter row of a menu that filters as you type 2026-08-31 20:41:22 +02:00
main_panels.go Reset other main views' scroll after copying content, not before 2026-08-15 15:30:27 +02:00
menu_panel.go Lay out the filter row of a menu that filters as you type 2026-08-31 20:41:22 +02:00
options_map.go Cleanup: filter out empty keybindings earlier 2026-05-28 19:26:43 +02:00
pty.go Render async content into an off-screen buffer and swap it in 2026-08-15 15:30:27 +02:00
pty_test.go Prevent stale index.lock files from diffs rendered through a pty on Windows 2026-08-04 06:53:53 +02:00
recent_repos_panel.go Remove unused field gui.IsNewRepo 2024-12-01 10:44:26 +01:00
side_panels.go Assign the transient contexts' initial windows from the side panel config 2026-07-17 12:07:24 +02:00
side_panels_test.go Assign the transient contexts' initial windows from the side panel config 2026-07-17 12:07:24 +02:00
tasks_adapter.go Drop FlushStaleCells, which no longer has anything to flush 2026-08-15 15:30:27 +02:00
tasks_adapter_test.go Never hand NewCmdTask a nil reader when a command fails to start 2026-07-23 17:31:26 +02:00
test_mode.go Dump goroutine stacks when the test watchdog fires 2026-07-20 14:26:25 +02:00
test_timeout_norace.go Scale the integration test watchdog up under the race detector 2026-07-20 14:26:25 +02:00
test_timeout_race.go Scale the integration test watchdog up under the race detector 2026-07-20 14:26:25 +02:00
view_helpers.go Filter a menu by typing into it 2026-08-31 20:41:22 +02:00
views.go Filter a menu by typing into it 2026-08-31 20:41:22 +02:00