summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-11-14 15:07:14 +0100
committerJan Holesovsky <kendy@collabora.com>2014-11-14 15:07:14 +0100
commit710c664083063b4ab5aaa246f204a6f4db9078c0 (patch)
treeb5e3026046bac9c74fce12029554a0c056a22b4e /bin
parent2ec556b0726e51010aebaa4849195444fda4aa1d (diff)
Script that finds commits in a branch that were not pushed to master.
Trivial, but based on the Change-Id's, so hopefully reliable enough :-) Change-Id: I919a2dc47f088ec4d1111750b74c68a0b062478d
Diffstat (limited to 'bin')
-rwxr-xr-xbin/check-merged.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/bin/check-merged.sh b/bin/check-merged.sh
new file mode 100755
index 000000000000..cd39c4253da1
--- /dev/null
+++ b/bin/check-merged.sh
@@ -0,0 +1,36 @@
+#! /bin/bash
+#
+# check that master contains all the patches from a brach
+# and list those that are missing
+#
+
+BRANCH="$1"
+[ -z "$BRANCH" ] && {
+ cat 1>&2 << EOF
+check-merged.sh branchname
+
+Checks that all the patches from branch 'branchname' are in master, and
+reports the commits that are not.
+
+The check is based on the Change-Id's, so if some commits are missing it, they
+won't be detected as missing.
+EOF
+ exit 1;
+}
+
+function collect_change_ids {
+ git log `git merge-base origin/master origin/feature/opengl-vcl`.."$1" | \
+ sed 's/^commit /XXXcommitXXX/g' | \
+ tr '\n' ';' | \
+ sed 's/XXXcommitXXX/\n/g' | \
+ sed -e 's/;.*Change-Id://' -e 's/;.*$//' | \
+ grep -v '^$'> "$2"
+}
+
+collect_change_ids "$BRANCH" /tmp/check-merged.branch
+collect_change_ids "origin/master" /tmp/check-merged.master
+
+cat /tmp/check-merged.branch | \
+ while read COMMIT CHID ; do
+ [ -n "$CHID" -a "$CHID" != " " ] && grep -q "$CHID" /tmp/check-merged.master || echo "$COMMIT not in origin/master"
+ done