瀏覽代碼

更新脚本:支持时间参数:end_date

张鹏玄 6 年之前
父節點
當前提交
77b3d85cf6
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8
    2
      gitstats

+ 8
- 2
gitstats 查看文件

@@ -47,7 +47,8 @@ conf = {
47 47
 	'linear_linestats': 1,
48 48
 	'project_name': '',
49 49
 	'processes': 8,
50
-	'start_date': ''
50
+	'start_date': '',
51
+	'end_date': '',
51 52
 }
52 53
 
53 54
 def getpipeoutput(cmds, quiet = False):
@@ -74,8 +75,13 @@ def getpipeoutput(cmds, quiet = False):
74 75
 
75 76
 def getlogrange(defaultrange = 'HEAD', end_only = True):
76 77
 	commit_range = getcommitrange(defaultrange, end_only)
78
+	datesel = ''
77 79
 	if len(conf['start_date']) > 0:
78
-		return '--since="%s" "%s"' % (conf['start_date'], commit_range)
80
+		datesel = '--since="%s" %s' % (conf['start_date'], datesel)
81
+	if len(conf['end_date']) > 0:
82
+		datesel = '--until="%s" %s' % (conf['end_date'], datesel)
83
+        if (len(datesel) > 0):
84
+		commit_range = '%s "%s"' % (datesel, commit_range)
79 85
 	return commit_range
80 86
 
81 87
 def getcommitrange(defaultrange = 'HEAD', end_only = False):