|
30 | 30 | fp.write('\n')
|
31 | 31 |
|
32 | 32 | fp.write('## Changes from {0} to {1}\n'.format(previous_tag, current_tag))
|
33 |
| - subjects = subprocess.check_output(['git', 'log', '--pretty=%s', |
| 33 | + subjects = subprocess.check_output(['git', 'log', '--pretty=%s:%h', |
34 | 34 | '--no-merges', '{0}..{1}'.format(previous_tag, current_tag)]).decode('utf-8')
|
35 | 35 |
|
36 | 36 | bug_fixes = []
|
|
41 | 41 | style_changes = []
|
42 | 42 | for subject in subjects.split('\n'):
|
43 | 43 | prefix = subject.split(':')[0]
|
| 44 | + commit = subject.split(':')[-1] |
44 | 45 | if prefix == 'BUG':
|
45 | 46 | description = subject.split(':')[1]
|
46 |
| - bug_fixes.append(description) |
| 47 | + bug_fixes.append((description, commit)) |
47 | 48 | elif prefix == 'COMP':
|
48 | 49 | description = subject.split(':')[1]
|
49 |
| - platform_fixes.append(description) |
| 50 | + platform_fixes.append((description, commit)) |
50 | 51 | elif prefix == 'DOC':
|
51 | 52 | description = subject.split(':')[1]
|
52 |
| - doc_updates.append(description) |
| 53 | + doc_updates.append((description, commit)) |
53 | 54 | elif prefix == 'ENH':
|
54 | 55 | description = subject.split(':')[1]
|
55 |
| - enhancements.append(description) |
| 56 | + enhancements.append((description, commit)) |
56 | 57 | elif prefix == 'PERF':
|
57 | 58 | description = subject.split(':')[1]
|
58 |
| - performance_improvements.append(description) |
| 59 | + performance_improvements.append((description, commit)) |
59 | 60 | elif prefix == 'STYLE':
|
60 | 61 | description = subject.split(':')[1]
|
61 |
| - style_changes.append(description) |
| 62 | + style_changes.append((description, commit)) |
| 63 | + |
| 64 | + commit_link_prefix = 'https://github.com/InsightSoftwareConsortium/itkwidgets/commit/' |
62 | 65 |
|
63 | 66 | if enhancements:
|
64 | 67 | fp.write('\n### Enhancements\n\n')
|
65 |
| - for subject in enhancements: |
| 68 | + for subject, commit in enhancements: |
66 | 69 | if subject.find('Bump itkwidgets version for development') != -1:
|
67 | 70 | continue
|
68 |
| - fp.write('- {0}\n'.format(subject)) |
| 71 | + fp.write('- {0}'.format(subject)) |
| 72 | + fp.write(' ([{0}]({1}{0}))\n'.format(commit, commit_link_prefix)) |
69 | 73 |
|
70 | 74 | if performance_improvements:
|
71 | 75 | fp.write('\n### Performance Improvements\n\n')
|
72 |
| - for subject in performance_improvements: |
73 |
| - fp.write('- {0}\n'.format(subject)) |
| 76 | + for subject, commit in performance_improvements: |
| 77 | + fp.write('- {0}'.format(subject)) |
| 78 | + fp.write(' ([{0}]({1}{0}))\n'.format(commit, commit_link_prefix)) |
74 | 79 |
|
75 | 80 | if doc_updates:
|
76 | 81 | fp.write('\n### Documentation Updates\n\n')
|
77 |
| - for subject in doc_updates: |
78 |
| - fp.write('- {0}\n'.format(subject)) |
| 82 | + for subject, commit in doc_updates: |
| 83 | + fp.write('- {0}'.format(subject)) |
| 84 | + fp.write(' ([{0}]({1}{0}))\n'.format(commit, commit_link_prefix)) |
79 | 85 |
|
80 | 86 | if platform_fixes:
|
81 | 87 | fp.write('\n### Platform Fixes\n\n')
|
82 |
| - for subject in platform_fixes: |
83 |
| - fp.write('- {0}\n'.format(subject)) |
| 88 | + for subject, commit in platform_fixes: |
| 89 | + fp.write('- {0}'.format(subject)) |
| 90 | + fp.write(' ([{0}]({1}{0}))\n'.format(commit, commit_link_prefix)) |
84 | 91 |
|
85 | 92 | if bug_fixes:
|
86 | 93 | fp.write('\n### Bug Fixes\n\n')
|
87 |
| - for subject in bug_fixes: |
88 |
| - fp.write('- {0}\n'.format(subject)) |
| 94 | + for subject, commit in bug_fixes: |
| 95 | + fp.write('- {0}'.format(subject)) |
| 96 | + fp.write(' ([{0}]({1}{0}))\n'.format(commit, commit_link_prefix)) |
89 | 97 |
|
90 | 98 | if style_changes:
|
91 | 99 | fp.write('\n### Style Changes\n\n')
|
92 |
| - for subject in style_changes: |
93 |
| - fp.write('- {0}\n'.format(subject)) |
| 100 | + for subject, commit in style_changes: |
| 101 | + fp.write('- {0}'.format(subject)) |
| 102 | + fp.write(' ([{0}]({1}{0}))\n'.format(commit, commit_link_prefix)) |
0 commit comments