TortoiseGit Shell Integration and Git CLI Log Pagination Interoperability
0 reputation · 11 Oct 2021, 19:49 UTC
0 reputation · 11 Oct 2021, 19:49 UTC
Goal: achieve consistent, non-blocking commit-log navigation when invoking TortoiseGit Show Log from Windows Explorer on large repositories, ensuring that the incremental loading behavior aligns with the underlying Git revision-range retrieval without exposing pagination controls to the user.
Constraints: TortoiseGit currently loads commits in batches as the user scrolls, with no configurable page size, and depends on Git's revision-range fetch which can stall the UI for histories beyond ~5k commits; the Shell extension and Git CLI lack a shared pagination API, leaving the mapping of scroll‑triggered loads to Git calls unspecified.
34775 reputation · 12 Oct 2021, 03:32 UTC
Each scroll-triggered batch in TortoiseGit's Show Log dialog is a fixed, source-level constant (commonly cited as 100 commits per fetch), not a configurable value. There is no UI option, registry key, or environment variable that changes it, so the Shell extension cannot signal a desired batch size to Git without modifying and rebuilding TortoiseGit. Prefetching is possible only indirectly, via a git.exe wrapper that serves cached output — a workable but fragile workaround.
When you scroll upward in Show Log, TortoiseGit issues another revision-range query to Git (effectively a git log with a max-count and skip/limit derived from the scroll position). The number of commits per request is hard-coded in the log dialog implementation. Because the value is compiled in, the mapping from "user scrolled" to "Git fetch of N commits" is fixed at build time. The stalls you see past ~5k commits are not caused by the batch size itself but by Git re-walking history for each range request on a large DAG, plus the Shell extension's synchronous round trip.
No — not through any supported mechanism. The Shell extension and the Git CLI share only the command line; TortoiseGit constructs that command line internally and exposes no hook for page sizing. To confirm this on your own machine rather than taking it on faith:
git.exe / TortoiseGitProc.exe while scrolling in Show Log. Note the -n/--max-count and --skip arguments — the observed max-count is your effective batch size.The only clean way to change it is a source patch (adjust the fetch constant in the log dialog code) and a private build — with the ongoing cost of merging upstream security and feature updates yourself.
There is no built-in prefetch, but you can approximate one by interposing on the Git executable TortoiseGit calls:
git log --date-order -n 5000 --pretty=format:%H > %TEMP%\tgit-log-cache.txt, refreshed on a schedule or post-commit hook.log invocation patterns TortoiseGit uses, stream the cached output; for everything else, pass through to the real git.exe.This preserves the scroll-to-load interaction — TortoiseGit still issues its fixed-size requests — but each request is served from disk instead of re-walking the repository, eliminating most UI freezes.
post-fetch/post-merge hook or filesystem watcher on .git/refs).If the wrapper route feels too fragile, the pragmatic alternative is reducing the work per fetch: limit Show Log to a branch or date range, or enable Git's commit-graph (git config core.commitGraph true and git commit-graph write --reachable), which significantly speeds history walks on large repositories and benefits TortoiseGit without any patching.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.