[Openvpn-devel,v2] dev-tools/gerrit-send-mail.py: include Gerrit URL into the commit message

Message ID 20250917120720.30738-1-gert@greenie.muc.de
State New
Headers show
Series [Openvpn-devel,v2] dev-tools/gerrit-send-mail.py: include Gerrit URL into the commit message | expand

Commit Message

Gert Doering Sept. 17, 2025, 12:07 p.m. UTC
We used to reference to one of the mailing list archives as the formal
reference for the patch and the review discussions.  With the problematic
reliability of the archives, I've started to manually add the URLs in
the OpenVPN Gerrit to the commits because they give a better reference
and (usually) all the feedback is there in a useful format.

So, enhance this dev-tool script to do this automatically.

Change-Id: Idb137ecbade4b0584a4d74aee34978062e247bc5
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1196
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1196
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <frank@lichtenheld.com>

Comments

Gert Doering Sept. 17, 2025, 1:18 p.m. UTC | #1
Yay, my first Python code... :-)

And tested with this very e-mail - and of course, mail-archive.org is
acting up again, and not showing the "PATCH" e-mail..

Your patch has been applied to the master branch.

commit 168792766dedc2dab41347fa394fc244c73247e8
Author: Gert Doering
Date:   Wed Sep 17 14:07:15 2025 +0200

     dev-tools/gerrit-send-mail.py: include Gerrit URL into the commit message

     Signed-off-by: Gert Doering <gert@greenie.muc.de>
     Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1196
     Message-Id: <20250917120720.30738-1-gert@greenie.muc.de>
     URL: https://sourceforge.net/p/openvpn/mailman/message/59234672/
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/dev-tools/gerrit-send-mail.py b/dev-tools/gerrit-send-mail.py
index 0b49ae9..450e920 100755
--- a/dev-tools/gerrit-send-mail.py
+++ b/dev-tools/gerrit-send-mail.py
@@ -99,6 +99,7 @@ 
     assert comment_start > signed_off_end
     acked_by_text = ""
     acked_by_names = ""
+    gerrit_url = f"{args.url}/c/{details['project']}/+/{args.changeid}"
     for ack in details["acked_by"]:
         acked_by_text += f"Acked-by: {ack}\n"
         acked_by_names += f"{ack}\n"
@@ -106,12 +107,13 @@ 
         patch_text[:signed_off_end]
         + signed_off_text
         + acked_by_text
+        + f"Gerrit URL: {gerrit_url}\n"
         + patch_text[signed_off_end:comment_start]
         + f"""
 This change was reviewed on Gerrit and approved by at least one
 developer. I request to merge it to {details["target"]}.
 
-Gerrit URL: {args.url}/c/{details["project"]}/+/{args.changeid}
+Gerrit URL: {gerrit_url}
 This mail reflects revision {details["revision"]} of this Change.
 {signed_off_comment}
 Acked-by according to Gerrit (reflected above):