#!/bin/sh pgm="${0##*/}" what="${1:-usage}" # vim: syntax=sh # echo "--- # $pgm" if [ "x$what" = 'xusage' ]; then cat <&1 | tee transcript.log echo // checking out $tag git checkout $tag 2>&1 | tee -a transcript.log git log -1 cd $top/lib echo // updating $top/lib git pull --ff-only origin master 2>&1 | tee -a transcript.log git log -1 echo "---" } tclog() { echo "$pgm: transcript log" tail -f transctip.log echo "---" } tctest() { tc="$2" echo "$pgm: running $1 $tc" echo "---" } tcrun() { cmd="$@" echo "$pgm: running $cmd" $cmd echo "..." } tcdebug() { shift; cmd="$@" echo "$pgm: running $cmd in debug mode..." echo "---" } tcversion() { top=$(git rev-parse --show-toplevel) gitid0=$(git rev-parse --short HEAD) git pull --ff-only --recurse-submodules=yes origin master 1>> transcript.log 2>&1 git checkout $tag 1>> transcript.log 2>&1 gitid1=$(git rev-parse --short HEAD) if [ "x$gitid0" != "x$gitid1" ]; then gitid1=$gitdi0-$gitid1; fi cd $top/lib git pull --ff-only origin master 1>> transcript.log 2>&1 gitid2=$(git rev-parse --short HEAD) echo Version: $gitid1-$gitid2 } main $@; exit $?; true; # $Source: /my/shell/scripts/toychain.sh $