From: Fredrik Tolf Date: Sun, 6 Jan 2008 00:57:17 +0000 (+0100) Subject: Created the dcp-recent script. X-Git-Url: http://dolda2000.com/gitweb/?p=dcp.git;a=commitdiff_plain;h=a69a41b117eca2c76262c8ab5a694040a91fbe8e Created the dcp-recent script. --- diff --git a/dcp-recent b/dcp-recent new file mode 100755 index 0000000..951ce25 --- /dev/null +++ b/dcp-recent @@ -0,0 +1,36 @@ +#!/bin/sh + +set -e + +usage() { + echo "usage: dcp-recent REPODIR" +} + +rungit() { + ( + cd "$repodir" + git "$@" + ) || false +} + +if [ $# -lt 1 ]; then + usage >&2 + exit 1 +fi + +repodir="$1" +shift + +if [ ! -d "$repodir" ]; then + echo "dcp-recent: cannot find $repodir" >&2 + exit 1 +fi + +if ! rungit tag -l | grep -q ^lastbuild$; then + exit 1 +fi + +lastbuild="$(rungit rev-parse lastbuild)" +master="$(rungit rev-parse master)" + +[ "$master" = "$lastbuild" ]