Script to check whether a branch is up to date

This commit is contained in:
Rafa de la Torre 2016-08-09 15:42:01 +02:00
parent 33aff6a744
commit 58ef79fb6a
2 changed files with 17 additions and 0 deletions

View File

@ -1,6 +1,7 @@
language: c
before_install:
- ./check-up-to-date-with-master.sh
- sudo apt-get -y install python-pip
- sudo apt-get -y install python-software-properties

16
check-up-to-date-with-master.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# Add remote-master
git remote add -t master remote-master https://github.com/CartoDB/crankshaft.git
# Fetch master reference
git fetch --depth=1 remote-master master
# Compare HEAD with master
# NOTE: travis by default uses --depth=50 so we are actually checking that the tip
# of the branch is no more than 50 commits away from master as well.
git rev-list HEAD | grep $(git rev-parse remote-master/master) ||
{ echo "Your branch is not up to date with latest release";
echo "Please update it by running the following:";
echo " git fetch && git merge origin/develop";
false; }