From: "flichtenheld (Code Review)" Date: Mon, 23 Mar 2026 12:21:30 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <0bfbfb06fc3d2a05af9efb3d13a04bda3848fbbb-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="wkxP95kYWC0="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: dev-tools: Add new script to convert mails to Gerrit patches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --wkxP95kYWC0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1585?usp=3Demail to review the following change. Change subject: dev-tools: Add new script to convert mails to Gerrit patches ...................................................................... dev-tools: Add new script to convert mails to Gerrit patches Also checks for some common issues. Change-Id: I52773764e0f4056fe5367918a9b2e6720b165c21 Signed-off-by: Frank Lichtenheld --- A dev-tools/gerrit-submit-from-mail.sh 1 file changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/85/1585/1 diff --git a/dev-tools/gerrit-submit-from-mail.sh b/dev-tools/gerrit-submit= -from-mail.sh new file mode 100755 index 0000000..ac1988f --- /dev/null +++ b/dev-tools/gerrit-submit-from-mail.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +# Assertions: +# - there is a remote called "gerrit" that can be used to +# pushed to gerrit. Create it with +# git remote add gerrit ssh://@gerrit.openvpn.net:2= 9418/openvpn.git +# - the master branch does not contain pending commits, move them to branc= hes +# +# Usage: +# - Pipe mail to this script on stdin +# - You can specify the target branch as the first argument to the script +# if it is not master. + +set -eu + +TARGET_BRANCH=3D${1:-master} +SOURCE_DIR=3D$(dirname $(readlink -e "${BASH_SOURCE[0]}")) +TIMESTAMP=3D$(date +%Y%M%dT%H%S) + +git -C $SOURCE_DIR checkout $TARGET_BRANCH +git -C $SOURCE_DIR checkout -B mail-submit-${TIMESTAMP} +git -C $SOURCE_DIR am + +warnings=3D0 +if git -C $SOURCE_DIR log -n1 --format=3D%an | grep -q "via Openvpn-devel"= ; then + echo WARNING: Author contains \"via Openvpn-devel\" + echo Try to get an actual email-adress from the submitter! + warnings=3D$((warnings + 1)) +fi + +if ! git -C $SOURCE_DIR log -n1 --format=3D%b | grep -qi "signed-off-by:";= then + echo WARNING: Signed-off-by: line missing + echo Consider adding it. + warnings=3D$((warnings + 1)) +fi + +if [ "$warnings" -ge 0 ]; then + echo Please fix the $warnings warnings above before pushing. + echo Push the changes with git -C $SOURCE_DIR push gerrit HEAD:refs/fo= r/$TARGET_BRANCH +else + echo git -C $SOURCE_DIR push gerrit HEAD:refs/for/$TARGET_BRANCH +fi -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1585?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I52773764e0f4056fe5367918a9b2e6720b165c21 Gerrit-Change-Number: 1585 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos --wkxP95kYWC0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

dev-tools: Add new script to convert mails =
to Gerrit patches

Also checks for some common issues.

Change-= Id: I52773764e0f4056fe5367918a9b2e6720b165c21
Signed-off-by: Frank Licht= enheld <frank@...2641...>
---
A dev-tools/gerrit-submit-from-ma= il.sh
1 file changed, 42 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/85/1= 585/1
diff --git a/dev-tools/gerrit-submit-from-mail.sh b/dev-tools=
/gerrit-submit-from-mail.sh
new file mode 100755
= index 0000000..ac1988f
--- /dev/null
= +++ b/dev-tools/gerrit-submit-from-mail.sh
@@ -0,0 +1,42 @@=
+#!/bin/bash<= br>+
+# Assertions:
+# - there is a remote called "gerrit" tha= t can be used to
+# = pushed to gerrit. Create it with
+# git remote add gerrit ssh://<yourgerritusername>@= gerrit.openvpn.net:29418/openvpn.git
+# - the master branch does not contain pending commits, mo= ve them to branches
+= #
+# Usage:+# - Pipe mail to this script = on stdin
+# - You can= specify the target branch as the first argument to the script
+# if it is not master.<= br>+
+set -eu
+
+TA= RGET_BRANCH=3D${1:-master}
+SOURCE_DIR=3D$(dirname $(readlink -e "${BASH_SOURCE[0]}"))=
+TIMESTAMP=3D$(date = +%Y%M%dT%H%S)
+
+git -C $SOURCE_DIR checko= ut $TARGET_BRANCH
+gi= t -C $SOURCE_DIR checkout -B mail-submit-${TIMESTAMP}
+git -C $SOURCE_DIR am
+
+warnings=3D0
+if git -C $SOURCE_DIR log -n1 --format=3D%an | grep -q "via = Openvpn-devel"; then
+ echo WARNING: Author contains \"via Openvpn-devel\"
+ echo Try to get an = actual email-adress from the submitter!
+ warnings=3D$((warnings + 1))
+fi
+
+if= ! git -C $SOURCE_DIR log -n1 --format=3D%b | grep -qi "signed-off-by:= "; then
+ ech= o WARNING: Signed-off-by: line missing
+ echo Consider adding it.
+ warnings=3D$((warnings + 1))
+fi

+
+if [ "$warnings" -ge 0 ]; then
+ echo Please fix the $warnings warnings above = before pushing.
+ = echo Push the changes with git -C $SOURCE_DIR push gerrit HEAD:refs/for/$TA= RGET_BRANCH
+else
+ echo git -C $SOURCE= _DIR push gerrit HEAD:refs/for/$TARGET_BRANCH
+fi

To view, v= isit cha= nge 1585. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I52773764e0f4056fe5367918a9b= 2e6720b165c21
Gerrit-Change-Number: 1585
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
= --wkxP95kYWC0=--