Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion doc/gitstats.pod
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ Project name to show on the generated pages. Default is to use basename of the r

=item start_date

Specify a starting date to pass with --since to git.
Specify a starting date to pass with --since to git. If end_date is used it will pass --after to git.

=item end_date

Specify a end date to pass with --before to git.

=item style

Expand Down
10 changes: 8 additions & 2 deletions gitstats
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ conf = {
'linear_linestats': 1,
'project_name': '',
'processes': 8,
'start_date': ''
'start_date': '',
'end_date': ''
}

def getpipeoutput(cmds, quiet = False):
Expand All @@ -74,8 +75,13 @@ def getpipeoutput(cmds, quiet = False):

def getlogrange(defaultrange = 'HEAD', end_only = True):
commit_range = getcommitrange(defaultrange, end_only)
if len(conf['start_date']) > 0:
if len(conf['start_date']) > 0 and len(conf['end_date']) > 0:
return '--after="%s" --before="%s" "%s"' % (conf['start_date'],
conf['end_date'],
commit_range)
elif len(conf['start_date']) > 0:
return '--since="%s" "%s"' % (conf['start_date'], commit_range)

return commit_range

def getcommitrange(defaultrange = 'HEAD', end_only = False):
Expand Down