cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/530?usp=email )
Change subject: gerrit-send-mail: add missing Signed-off-by ...................................................................... gerrit-send-mail: add missing Signed-off-by Our development documentation says we add this automatically when it is missing. So let's do that here as well. Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa Signed-off-by: Frank Lichtenheld <fr...@lichtenheld.com> Acked-by: Gert Doering <g...@greenie.muc.de> Message-Id: <20240308120557.9065-1-g...@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28362.html Signed-off-by: Gert Doering <g...@greenie.muc.de> --- M dev-tools/gerrit-send-mail.py 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.py index 67a2cf1..10305e2 100755 --- a/dev-tools/gerrit-send-mail.py +++ b/dev-tools/gerrit-send-mail.py @@ -50,6 +50,12 @@ ack = f"{reviewer_name} <{reviewer_mail}>" print(f"Acked-by: {ack}") acked_by.append(ack) + # construct Signed-off-by in case it is missing + owner = json_data["owner"] + owner_name = owner.get("display_name", owner["name"]) + owner_mail = owner.get("email", owner["name"]) + sign_off = f"{owner_name} <{owner_mail}>" + print(f"Signed-off-by: {sign_off}") change_id = json_data["change_id"] # assumes that the created date in Gerrit is in UTC utc_stamp = ( @@ -67,6 +73,7 @@ "target": json_data["branch"], "msg_id": msg_id, "acked_by": acked_by, + "sign_off": sign_off, } @@ -81,10 +88,14 @@ def apply_patch_mods(patch_text, details, args): comment_start = patch_text.index("\n---\n") + len("\n---\n") + signed_off_text = "" + signed_off_comment = "" try: signed_off_start = patch_text.rindex("\nSigned-off-by: ") signed_off_end = patch_text.index("\n", signed_off_start + 1) + 1 except ValueError: # Signed-off missing + signed_off_text = f"Signed-off-by: {details['sign_off']}\n" + signed_off_comment = "\nSigned-off-by line for the author was added as per our policy.\n" signed_off_end = patch_text.index("\n---\n") + 1 assert comment_start > signed_off_end acked_by_text = "" @@ -94,6 +105,7 @@ acked_by_names += f"{ack}\n" patch_text_mod = ( patch_text[:signed_off_end] + + signed_off_text + acked_by_text + patch_text[signed_off_end:comment_start] + f""" @@ -102,6 +114,7 @@ Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid} This mail reflects revision {details["revision"]} of this Change. +{signed_off_comment} Acked-by according to Gerrit (reflected above): {acked_by_names} """ -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/530?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: If9cb7d66f079fe1c87fcb5b4e59bc887533d77fa Gerrit-Change-Number: 530 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld <fr...@lichtenheld.com> Gerrit-Reviewer: cron2 <g...@greenie.muc.de> Gerrit-Reviewer: plaisthos <arne-open...@rfc2549.org> Gerrit-CC: openvpn-devel <openvpn-devel@lists.sourceforge.net> Gerrit-MessageType: merged
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel