From d130d9f9182b45838e8aeedfa0e2ef80c24dc363 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 13 Nov 2022 21:32:44 +0100 Subject: [PATCH 1/3] Rellocate some text in CONTRIBUTORS.md --- CONTRIBUTORS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2781d7e431..bcbbb783b3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,3 +1,5 @@ +_If we have forgotten your name, please contact us_ + ## Libevent Contributors * Samy Al Bahra * Antony Antony @@ -201,5 +203,3 @@ * Philip Prindeville * Vis Virial * Sayan Nandan - -If we have forgotten your name, please contact us \ No newline at end of file From 7c8b3e99679ef5853f266ac31f26bf49fb06d852 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 13 Nov 2022 21:44:10 +0100 Subject: [PATCH 2/3] Add a script to add new contributors --- extra/release/update-contributors.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 extra/release/update-contributors.sh diff --git a/extra/release/update-contributors.sh b/extra/release/update-contributors.sh new file mode 100755 index 0000000000..fe896b645a --- /dev/null +++ b/extra/release/update-contributors.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +function path_in_repo() +{ + echo "$(git rev-parse --show-toplevel)/$*" +} +function main() +{ + local new_contributors + new_contributors="$(mktemp libevent.XXXXXX)" + trap "rm $new_contributors $new_contributors.filtered" EXIT + + git log "$(git describe --abbrev=0)..HEAD" --pretty='format:%cN%n%aN' > "$new_contributors" + awk '/^ \* / { split($0, cols, " \\* "); print(cols[2]); }' "$(path_in_repo CONTRIBUTORS.md)" | { + grep -F -x -v -f "$new_contributors" + } | { + local grep_patterns=( + GitHub + ) + grep -F -x -v "${grep_patterns[@]}" + } > "$new_contributors.filtered" + awk '{printf(" * %s\n", $0)}' "$new_contributors.filtered" >> "$(path_in_repo CONTRIBUTORS.md)" +} +main "$@" From acd4cc63e855300691f244c09e67ca02fc2d31fc Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 13 Nov 2022 21:53:17 +0100 Subject: [PATCH 3/3] Add a script to generate changelog --- extra/release/changelog.py | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 extra/release/changelog.py diff --git a/extra/release/changelog.py b/extra/release/changelog.py new file mode 100755 index 0000000000..aec2af1960 --- /dev/null +++ b/extra/release/changelog.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 + +import git +import argparse +import re + +def parse_opts(): + p = argparse.ArgumentParser() + p.add_argument('--git-root', default='.') + p.add_argument('--no-squash-merge-childs', action='store_true') + p.add_argument('--abbrev', default=8, type=int) + # git config pretty.le + p.add_argument('--format', default=' o %(s)s (%(h)s %(aN)s)') + p.add_argument('--revision-range') + return p.parse_args() + +def main(): + opts = parse_opts() + repo = git.Repo(opts.git_root) + squash = not opts.no_squash_merge_childs + + ignore = [] + + revision_range = opts.revision_range + if not revision_range: + revision_range = repo.git.describe('--abbrev=0') + '..' + + for commit in repo.iter_commits(revision_range): + if squash: + if commit.hexsha in ignore: + continue + if len(commit.parents) > 1: + for c in repo.iter_commits('{}..{}'.format(*commit.parents)): + ignore.append(c.hexsha) + print(opts.format % { + 's': commit.summary, + 'h': commit.hexsha[:opts.abbrev], + 'aN': str(commit.author), + }) + + +if __name__ == "__main__": + main()