File tree 1 file changed +15
-7
lines changed
1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 26
26
shell = True ,
27
27
).decode ('utf8' ).split ('\n ' )
28
28
29
- now = datetime .now ()
30
-
31
29
tags = {}
32
30
tag_commits = []
33
31
for line in git_log :
34
32
parts = line .split ()
35
33
if len (parts ) == 1 :
36
34
tag_commits .append (parts [0 ])
37
- elif len (parts ) > 1 and parts [1 ] == 'tag:' :
38
- tags [tag ] = tag_commits
39
- tag = parts [2 ]
40
- tag_commits = [parts [0 ]]
35
+ continue
36
+
37
+ for i , part in enumerate (parts ):
38
+ if part == 'tag:' :
39
+ tags [tag ] = tag_commits
40
+ tag = parts [i + 1 ].strip (',' )
41
+ tag_commits = [parts [0 ]]
42
+
43
+ # add remaining commits to last seen tag
44
+ tags [tag ] = tag_commits
41
45
42
46
lines = []
43
47
for tag , shas in tags .items ():
51
55
shell = True ,
52
56
).decode ('utf8' ).split ('\n ' )[0 ].split ('--sep--' )
53
57
if description .startswith ('Release ' ):
54
- lines .append (f' { now .year } -{ now .month } -{ now .day } { description } ' )
58
+ date = subprocess .check_output (
59
+ f"git log --format='%as' -n1 { sha } " ,
60
+ shell = True ,
61
+ ).decode ('utf8' ).strip ()
62
+ lines .append (f' { date } { description } ' )
55
63
continue
56
64
try :
57
65
commit = repo .get_commit (sha )
You can’t perform that action at this time.
0 commit comments