Created
January 31, 2021 14:06
-
-
Save md2perpe/62cd98851db21010fad0c235946e5045 to your computer and use it in GitHub Desktop.
Prepare commit message for merge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import fileinput | |
import re | |
if sys.argv[2] == "merge": | |
with fileinput.input(sys.argv[1], inplace=True) as f: | |
for line in f: | |
if line.startswith("Merge branch"): | |
print("Merge") | |
print() | |
for b in re.findall("'(.+?)'", line): | |
print(f"* {b}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment