From 77b3d85cf61446dc42e731953d5f81154115cb2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E9=B9=8F=E7=8E=84?= Date: Wed, 10 Jul 2019 14:24:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC=EF=BC=9A?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=97=B6=E9=97=B4=E5=8F=82=E6=95=B0=EF=BC=9A?= =?UTF-8?q?end=5Fdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gitstats | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gitstats b/gitstats index c71b0e4..9d7acd0 100755 --- a/gitstats +++ b/gitstats @@ -47,7 +47,8 @@ conf = { 'linear_linestats': 1, 'project_name': '', 'processes': 8, - 'start_date': '' + 'start_date': '', + 'end_date': '', } def getpipeoutput(cmds, quiet = False): @@ -74,8 +75,13 @@ def getpipeoutput(cmds, quiet = False): def getlogrange(defaultrange = 'HEAD', end_only = True): commit_range = getcommitrange(defaultrange, end_only) + datesel = '' if len(conf['start_date']) > 0: - return '--since="%s" "%s"' % (conf['start_date'], commit_range) + datesel = '--since="%s" %s' % (conf['start_date'], datesel) + if len(conf['end_date']) > 0: + datesel = '--until="%s" %s' % (conf['end_date'], datesel) + if (len(datesel) > 0): + commit_range = '%s "%s"' % (datesel, commit_range) return commit_range def getcommitrange(defaultrange = 'HEAD', end_only = False):