[edk2-devel] [PATCH 3/3] BaseTools: Add script to help git-send-email pick addresses to cc

Philippe Mathieu-Daudé philmd at redhat.com
Wed Oct 16 14:09:40 UTC 2019


Add a new script GitCcCmd.sh that git-send-email can use to
automatically determine which addresses to cc on patch submission.

Signed-off-by: Philippe Mathieu-Daude <philmd at redhat.com>
---
 BaseTools/Scripts/GitCcCmd.sh | 38 +++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100755 BaseTools/Scripts/GitCcCmd.sh

diff --git a/BaseTools/Scripts/GitCcCmd.sh b/BaseTools/Scripts/GitCcCmd.sh
new file mode 100755
index 000000000000..3afdf3f1e40b
--- /dev/null
+++ b/BaseTools/Scripts/GitCcCmd.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+###
+# @file
+# Shell script to be called by 'git-send-email --cc-cmd' to pick the correct
+# maintainer emails for each patch when sending a series.
+#
+# Copyright (C) 2019, Red Hat, Inc.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+# This script expects the following EDK2 environment variables defined:
+# - WORKSPACE
+# - EDK_TOOLS_PATH
+#
+###
+
+set -e
+
+#
+# git-send-email calls this script with a list of patches generated by
+# git-format-patch.
+#
+for arg in $@; do
+    case ${arg} in
+    *0000-cover-letter.patch)
+        break
+        ;;
+    *.patch)
+        test -e ${arg} && (
+            cd ${WORKSPACE} && \
+            head -1 < ${arg} \
+            | cut -d' ' -f2 \
+            | xargs python ${EDK_TOOLS_PATH}/Scripts/GetMaintainer.py --quiet
+        )
+        break
+        ;;
+    esac
+done
-- 
2.21.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#49107): https://edk2.groups.io/g/devel/message/49107
Mute This Topic: https://groups.io/mt/34560656/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list