Browse Source

Merge 1bd4f015975a831efa1c36c42364ad1079c0d123 into 55c5c285558c410bb35ebf421245d320ab9ee9fa

sagiru 8 years ago
parent
commit
5c443f96d9
2 changed files with 13 additions and 3 deletions
  1. 5
    1
      doc/gitstats.pod
  2. 8
    2
      gitstats

+ 5
- 1
doc/gitstats.pod View File

63
 
63
 
64
 =item start_date
64
 =item start_date
65
 
65
 
66
-Specify a starting date to pass with --since to git.
66
+Specify a starting date to pass with --since to git. If end_date is used it will pass --after to git.
67
+
68
+=item end_date
69
+
70
+Specify a end date to pass with --before to git.
67
 
71
 
68
 =item style
72
 =item style
69
 
73
 

+ 8
- 2
gitstats View File

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