Search code examples
gitgitk

Paginating commits in gitk while viewing


When using gitk to view the history of a large project, like linux, gitk tries to load all the commits in memory which ultimately freezes the whole machine. This is because the history of the project is too big to be held in RAM.

So is there a way to view a few commits first and then the rest, just like pagination in a web application?

I checked the gitk manual (http://git-scm.com/docs/gitk) which specifies the option to give revision range, but this assumes that we know the range to observe from beforehand. Like we cannot tell that first 50 commits lie between these two commits.

The real problem is memory overflow. What i want is gitk to load only a few commits at a time in memory and not the whole history.

Any advice?

Thanks in advance


Solution

  • Gitk does not support this directly (especially loading later revisions on demand). However, you can restrict the range you want to display without knowing exactly what the versions are.

    For example, you can show only the last 50 commits by specifying a revision range using the A..B syntax:

     gitk HEAD~50..HEAD
    

    Then, if you need to look at the “next page”, you can adjust the numbers:

     gitk HEAD~100..HEAD~50