]> git.ozlabs.org Git - next-scripts/commitdiff
add get_commit
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Aug 2020 01:46:03 +0000 (11:46 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 19 Aug 2020 01:46:03 +0000 (11:46 +1000)
a helper when constructing emails

get_commit [new file with mode: 0755]

diff --git a/get_commit b/get_commit
new file mode 100755 (executable)
index 0000000..3878b78
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+commit=
+if [ "$1" ]; then
+        commit=$1
+        shift
+else
+       printf 'Usage: %s <commit>\n' "$0" 1>&2
+       exit 1
+fi
+
+tools_dir=$(dirname "$0")
+. "$tools_dir/common.sh"
+
+"$tools_dir/clog" "$commit"
+
+git log -1 --format='Cc: %an <%ae>%nCc: %cn <%ce>' "$commit" | sort -u
+
+exit 0