Added submodule changelog ganerator:
Updated FML: MinecraftForge/FML@e74087ee43 Ignore again, testing submodule.
This commit is contained in:
parent
d6a86916eb
commit
d1479d1a77
2 changed files with 47 additions and 1 deletions
2
fml
2
fml
|
@ -1 +1 @@
|
|||
Subproject commit f329084f1f0e2989fff58c0fc7c7275766c3d4fd
|
||||
Subproject commit e74087ee430633475c3ca058e54e3ef242a9d6aa
|
46
submodule_changlog.py
Normal file
46
submodule_changlog.py
Normal file
|
@ -0,0 +1,46 @@
|
|||
import subprocess, sys, os
|
||||
from pprint import pformat
|
||||
from optparse import OptionParser
|
||||
|
||||
def run_command(command, cwd='.'):
|
||||
#print('Running command: ')
|
||||
process = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=1, cwd=cwd)
|
||||
out, err = process.communicate()
|
||||
out = out.strip('\n')
|
||||
#print(pformat(out.split('\n')))
|
||||
if process.returncode:
|
||||
print('failed: %d' % process.returncode)
|
||||
return None
|
||||
return out.split('\n')
|
||||
|
||||
def main(options, args):
|
||||
output = run_command(['git', 'diff', '--no-color', '--', 'fml'])
|
||||
if output is None:
|
||||
print('Failed to grab submodule commits')
|
||||
sys.exit(1)
|
||||
|
||||
start = None
|
||||
end = None
|
||||
for line in output:
|
||||
if not 'Subproject commit' in line:
|
||||
continue
|
||||
if line[0:18] == '-Subproject commit':
|
||||
start = line[19:]
|
||||
elif line[0:18] == '+Subproject commit':
|
||||
end = line[19:]
|
||||
|
||||
if start == None or end == None:
|
||||
print('Could not extract start and end range')
|
||||
sys.exit(1)
|
||||
|
||||
output = run_command(['git', 'log', '--reverse', '--pretty=oneline', '%s...%s' % (start, end)], './fml')
|
||||
print('Updated FML:')
|
||||
for line in output:
|
||||
print('MinecraftForge/FML@%s' % line)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
options, args = parser.parse_args()
|
||||
|
||||
main(options, args)
|
Loading…
Reference in a new issue