forked from cplusplus/LWG
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_dates.py
More file actions
38 lines (30 loc) · 866 Bytes
/
make_dates.py
File metadata and controls
38 lines (30 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python
# usage: git log --raw --no-show-signature --pretty=%ct | python bin/make_dates.py > dates
import sys
import re
# The input looks like
# 1728481670
#
# :100644 100644 02412851ac 9f5998ba82 M xml/issue4159.xml
# :100644 100644 fa2274aa17 74485b30c1 M xml/issue4162.xml
# :100644 100644 8023699cb9 d007f71c08 M xml/issue4164.xml
mtimes = {}
current_mtime = ''
for l in sys.stdin.readlines():
l = l.rstrip()
if not l:
# blank line
continue
# timestamp
if l[0] != ':':
current_mtime = l
continue
# last piece of line is the file name
file = l.split()[-1]
m = re.match('xml/issue(\\d+).xml', file)
if m:
num = int(m[1])
if num not in mtimes:
mtimes[num] = current_mtime
for (num, time) in sorted(list(mtimes.items())):
print(f'{num:04} {time}')