Группа :: Разработка/Прочее
Пакет: mithraen-build-utils
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and FR Repocop
mithraen-build-utils-0.1.20/ 0000755 0000000 0000000 00000000000 12307537626 0015645 5 ustar 00root root 0000000 0000000 mithraen-build-utils-0.1.20/bin/ 0000755 0000000 0000000 00000000000 12307537626 0016415 5 ustar 00root root 0000000 0000000 mithraen-build-utils-0.1.20/bin/Co 0000755 0000000 0000000 00000001656 12307537626 0016714 0 ustar 00root root 0000000 0000000 #!/bin/sh
#=============================================================================#
# simple menu for git checkout (select branch) #
#=============================================================================#
# (c) Denis Smirnov <mithraen@freesource.info 14 Oct 2006 #
#=============================================================================#
# is this git repo?
if [ ! -d .git ]; then
echo "This is not git repo"
exit -1
fi
# Generate menu
T_M=`mktemp`
echo '--menu "Select branch for checkout" 0 0 0' >> $T_M
# Get default
DEFAULT="`git branch | grep '^\*' | sed 's/^..//' | tr -d "\n"`"
if [ "x$DEFAULT" != "x" ]; then
echo "\"$DEFAULT\" \"\"" >> $T_M
fi
# Get list
git branch | grep '^ ' | sed 's/^..\(.*\)/"\1" ""/' | sort >> $T_M
T1=`mktemp`
dialog --file $T_M 2> $T1
RC=$?
stty sane
clear
if [ $RC -eq 0 ]; then
git checkout `cat $T1`
fi
rm -f $T_M $T1