static-checks.sh: Show the exact commits being tested

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ie89b3c44a9eb1d7cffda2b5c9a6daf7b86294764
(cherry picked from commit 74cf0f1ef73291f4b0255b6e3bc6bee0b473155b)
diff --git a/script/static-checks/common.sh b/script/static-checks/common.sh
new file mode 100644
index 0000000..34aa53e
--- /dev/null
+++ b/script/static-checks/common.sh
@@ -0,0 +1,14 @@
+#
+# Copyright (c) 2024 Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+function get_base_branch() {
+    # Remove prefix
+    echo origin/${TF_GERRIT_BRANCH#refs/heads/}
+}
+
+function get_merge_base() {
+    git merge-base HEAD $(get_base_branch) | head -1
+}