<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -42,6 +42,13 @@ helpers do
     end 
     url + &quot;/&quot; + path
   end
+  def pagination_links
+    links = &quot;&quot;
+    page = params[:page] ? params[:page].to_i : 1
+    links += %{&lt;a href=&quot;#{request.path}?page=#{page-1}&quot;&gt;prev&lt;/a&gt; | } if page &gt; 1
+    links += %{&lt;a href=&quot;#{request.path}?page=#{page+1}&quot;&gt;next&lt;/a&gt;}
+    links
+  end
 end
 
 get '/favicon.ico' do</diff>
      <filename>app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,9 @@
 &lt;h2&gt;Branches&lt;/h2&gt;
 &lt;%= erb :repository_info, :layout =&gt; false %&gt;
 
-&lt;h2&gt;Commits&lt;/h2&gt;
+&lt;h2&gt;Commits &lt;%= pagination_links %&gt;&lt;/h2&gt;
 &lt;ul id=&quot;commits&quot;&gt;
-  &lt;% @repository.commits(@branch, false).each do |commit| %&gt;
+  &lt;% @repository.commits(@branch, 20, ((params[:page].to_i || 0) - 1) * 20).each do |commit| %&gt;
     &lt;li class=&quot;commit_details&quot;&gt;
       &lt;% @commit = commit %&gt;
       &lt;%= erb :commit_info, :layout =&gt; false %&gt;</diff>
      <filename>views/repository.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1daec37e44fedfad75a8debd0a0e57069cb1b672</id>
    </parent>
  </parents>
  <author>
    <name>James Adam</name>
    <email>james@lazyatom.com</email>
  </author>
  <url>http://github.com/lazyatom/gitnode/commit/cd0a9aa96ac433343500b59f617204c36621a2b9</url>
  <id>cd0a9aa96ac433343500b59f617204c36621a2b9</id>
  <committed-date>2009-06-15T00:26:04-07:00</committed-date>
  <authored-date>2009-06-15T00:26:04-07:00</authored-date>
  <message>Loading all commits can kill the server - let's paginate.</message>
  <tree>c0f5594c777a72f8bafda02a9a6706d21dcdd60e</tree>
  <committer>
    <name>James Adam</name>
    <email>james@lazyatom.com</email>
  </committer>
</commit>
