Update authors file in place
Instead of having AUTHORS.src and copying that to a new AUTHORS file with git log information appended to that have a single AUHTORS file and update it in place with git log info.
This commit is contained in:
parent
597bcca9ee
commit
5f63989ee0
1
AUTHORS
1
AUTHORS
|
@ -4514,6 +4514,7 @@ Jim Walker <jim[AT]couchbase.com>
|
||||||
Jim Young <jim.young.ws[AT]gmail.com>
|
Jim Young <jim.young.ws[AT]gmail.com>
|
||||||
Jim Young <jyoung[AT]gsu.edu>
|
Jim Young <jyoung[AT]gsu.edu>
|
||||||
Jiri Pirko <jiri[AT]resnulli.us>
|
Jiri Pirko <jiri[AT]resnulli.us>
|
||||||
|
Jiří Engelthaler <Jiri.Engelthaler[AT]zat.cz>
|
||||||
Jo Rueschel <wireshark[AT]rueschel.de>
|
Jo Rueschel <wireshark[AT]rueschel.de>
|
||||||
Jo-Philipp Wich <jo[AT]mein.io>
|
Jo-Philipp Wich <jo[AT]mein.io>
|
||||||
Joakim Andersson <joakim.andersson[AT]nordicsemi.no>
|
Joakim Andersson <joakim.andersson[AT]nordicsemi.no>
|
||||||
|
|
4008
AUTHORS.src
4008
AUTHORS.src
File diff suppressed because it is too large
Load Diff
|
@ -4087,7 +4087,7 @@ if (GIT_EXECUTABLE)
|
||||||
# Update AUTHORS file with entries from git shortlog
|
# Update AUTHORS file with entries from git shortlog
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
gen-authors
|
gen-authors
|
||||||
COMMAND ${PYTHON_EXECUTABLE} tools/generate_authors.py AUTHORS.src > AUTHORS
|
COMMAND ${PYTHON_EXECUTABLE} tools/generate_authors.py AUTHORS
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
)
|
)
|
||||||
else (GIT_EXECUTABLE)
|
else (GIT_EXECUTABLE)
|
||||||
|
|
|
@ -107,15 +107,23 @@ def generate_git_contributors_text(contributors_emails, git_authors_emails):
|
||||||
return "\n".join(output_lines)
|
return "\n".join(output_lines)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
# Read authos file until we find gitlog entries, then stop
|
||||||
stdoutu8 = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
def read_authors(parsed_args):
|
||||||
|
lines = []
|
||||||
|
with open(parsed_args.authors[0], 'r', encoding='utf-8') as fh:
|
||||||
|
for line in fh.readlines():
|
||||||
|
if '= From git log =' in line:
|
||||||
|
break
|
||||||
|
lines.append(line)
|
||||||
|
return ''.join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Generate the AUTHORS file combining existing AUTHORS file with git commit log.")
|
parser = argparse.ArgumentParser(description="Generate the AUTHORS file combining existing AUTHORS file with git commit log.")
|
||||||
parser.add_argument("authors", metavar='authors', nargs=1, help="path to AUTHORS file")
|
parser.add_argument("authors", metavar='authors', nargs=1, help="path to AUTHORS file")
|
||||||
parsed_args = parser.parse_args()
|
parsed_args = parser.parse_args()
|
||||||
|
|
||||||
with open(parsed_args.authors[0], encoding='utf-8') as fh:
|
author_content = read_authors(parsed_args)
|
||||||
author_content = fh.read()
|
|
||||||
|
|
||||||
# Collect the listed contributors emails so that we don't duplicate them
|
# Collect the listed contributors emails so that we don't duplicate them
|
||||||
# in the listing of git contributors
|
# in the listing of git contributors
|
||||||
|
@ -125,9 +133,11 @@ def main():
|
||||||
git_contributors_text = generate_git_contributors_text(contributors_emails, git_authors_emails)
|
git_contributors_text = generate_git_contributors_text(contributors_emails, git_authors_emails)
|
||||||
|
|
||||||
# Now we can write our output:
|
# Now we can write our output:
|
||||||
git_contributor_header = '\n\n= From git log =\n\n'
|
git_contributor_header = '= From git log =\n\n'
|
||||||
output = author_content + git_contributor_header + git_contributors_text + '\n'
|
output = author_content + git_contributor_header + git_contributors_text + '\n'
|
||||||
stdoutu8.write(output)
|
|
||||||
|
with open(parsed_args.authors[0], 'w', encoding='utf-8') as fh:
|
||||||
|
fh.write(output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue