Check each commit at least builds in CI
[rust-lightning] / ci / check-each-commit.sh
diff --git a/ci/check-each-commit.sh b/ci/check-each-commit.sh
new file mode 100755 (executable)
index 0000000..e4723c8
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+if [ "$1" = "" ]; then
+       echo "USAGE: $0 remote/head_branch"
+       echo "eg $0 upstream/main"
+       exit 1
+fi
+
+set -e
+set -x
+
+if [ "$(git log --pretty="%H %D" | grep "^[0-9a-f]*.* $1")" = "" ]; then
+       echo "It seems like the current checked-out commit is not based on $1"
+       exit 1
+fi
+git rebase --exec ci/check-compiles.sh $1