#! /bin/bash usage () { cat < "$DebugStream" ;then $ECHO $tmp $ECHO "icedust-describe: Error: Problem with ICEDUST_HOME and ICEDUST_PROJECT variables (see above messge)." $ECHO "Current values: " $ECHO " ICEDUST_HOME=$ICEDUST_HOME" $ECHO " ICEDUST_PROJECT=$ICEDUST_PROJECT" exit 1 fi ICEDUST_HOME=`sed 's!^.*ICEDUST_HOME=\([^;]\+\);.*!\1!' <<<$tmp` ICEDUST_PROJECT=`sed 's!^.*ICEDUST_PROJECT=\([^;]\+\);.*!\1!' <<<$tmp` unset tmp ### Main code to output description DescribeDirectory(){ local prefix="$1";shift local directory="$1";shift ( cd "$directory"; local branch="`git describe --all`" local commit="`git rev-parse --short HEAD`" local changes=`git diff --name-status |wc -l` local mods=`[ "$changes" -gt 0 ] && echo "__${changes}_UNCOMMITTED__" || true ` echo "$prefix:$branch($commit)$mods" ) } DescribeDirectory Packages "$ICEDUST_HOME/$ICEDUST_PROJECT/packages" DescribeDirectory Externals "$ICEDUST_HOME/$ICEDUST_PROJECT/packages/EXTERNALS" if $IncludeRepositoryScripts ;then DescribeDirectory Repository "$ICEDUST_REPOSITORY" fi