freechat/scripts/git-doc.py
2021-03-03 17:18:18 -08:00

35 lines
567 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'''
Additions: +
Modifications: *
Removals: -
Note/Warning !
'''
import sys
TMP_MSG_FILE = 'commit-message.tmp'
lines = []
for line in sys.stdin:
line = line.strip()
if line.startswith('+'):
line = '' + line[1:]
elif line.startswith('-'):
line = '' + line[1:]
elif line.startswith('*'):
line = '' + line[1:]
elif line.startswith('!'):
line = '' + line[1:]
lines.append(line)
with open(TMP_MSG_FILE, 'w') as target:
for line in lines:
print(line, file=target)