git-arr: interpret 'max_pages = 0' as unlimited

By default, git-arr limits the number of pages of commits to 5, however,
it is reasonable to expect that some projects will want all commits to
be shown. Rather than forcing such projects to choose an arbitrarily
large number as the value of 'max_pages', provide a formal mechanism to
specify unlimited commit pages.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>
This commit is contained in:
Eric Sunshine 2014-12-31 04:50:12 -05:00 committed by Alberto Bertogli
parent d7604dab4d
commit 9ef78aaffd
2 changed files with 4 additions and 1 deletions

@ -105,6 +105,8 @@ def load_config(path):
r.info.commits_in_summary = config.getint(s, 'commits_in_summary')
r.info.commits_per_page = config.getint(s, 'commits_per_page')
r.info.max_pages = config.getint(s, 'max_pages')
if r.info.max_pages <= 0:
r.info.max_pages = sys.maxint
r.info.generate_tree = config.getboolean(s, 'tree')
r.info.web_url = config.get(s, 'web_url')

@ -19,7 +19,8 @@ path = /srv/git/repo/
# Maximum number of per-branch pages for static generation (optional).
# When generating static html, this is the maximum number of pages we will
# generate for each branch's commit listings.
# generate for each branch's commit listings. Zero (0) means unlimited.
# Default: 5
#max_pages = 5
# Project website (optional).