]> source.dussan.org Git - vaadin-framework.git/commitdiff
Add script for automatically checking for unmerged commits
authorLeif Åstrand <leif@vaadin.com>
Tue, 24 Jul 2012 08:38:23 +0000 (11:38 +0300)
committerLeif Åstrand <leif@vaadin.com>
Tue, 24 Jul 2012 08:38:23 +0000 (11:38 +0300)
scripts/merge-check.sh [new file with mode: 0755]

diff --git a/scripts/merge-check.sh b/scripts/merge-check.sh
new file mode 100755 (executable)
index 0000000..0debea8
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/bash
+SINCE=$1
+UNTIL=$2
+
+if [ "$SINCE" = "" ] || [ "$UNTIL" = "" ]
+then
+       echo "Usage: $0 <since> <until>"
+       exit 3
+fi
+
+command="git --no-pager log --no-color $SINCE..$UNTIL"
+# TODO Why do I get whitespace in the beginning of the wc output?
+change_count=`$command --oneline|wc -l|tr -d ' '`
+
+if [ "$change_count" = "0" ]
+then
+       echo "No unmerged commits"
+       exit 0
+fi
+
+echo "There are $change_count commits that have not been merged from $UNTIL to $SINCE: "
+echo ""
+$command
+exit 1
\ No newline at end of file