aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/check_upstream
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/check_upstream')
-rwxr-xr-xscripts/check_upstream27
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/check_upstream b/scripts/check_upstream
new file mode 100755
index 0000000..9f20037
--- /dev/null
+++ b/scripts/check_upstream
@@ -0,0 +1,27 @@
1#! /bin/bash
2
3# This script is for repo forked from others
4# check $1(repo) if upstream branch origin/master is
5# ahead of local branch $2(default to dev)
6
7
8if [ ! -d $1 ]; then
9 return 0
10fi
11
12head='dev'
13if [ $# -eq 2 ]
14then
15 head=$2
16fi
17
18cd $1
19git fetch origin && \
20git rev-list $head | grep $(git rev-parse origin/master) > /dev/null
21
22if [ $? -ne 0 ]
23then
24 echo "New commit at" $1
25fi
26
27echo $(date) check $1 >> $SETTING_DIR/log