-######################################################################
-# Track uncommited files (I presume this is very ugly from a real git
-# user perspective)
-
-function git-fm () {
- CURRENT_DIR=$(pwd)
- NB_SUBDIR=0
-
- for i in $(find -name ".git"); do
- NB_SUBDIR=$((NB_SUBDIR+1))
- cd ${CURRENT_DIR}/$(dirname $i)
- NB_MODIFIED=$(git status | grep modified | wc -l)
- if [[ ${NB_MODIFIED} -gt 0 ]]; then
- echo "$(dirname $i) (${NB_MODIFIED})"
- git status | grep modified \
- | sed -e "s/^#\t/ /" | sed -e "s/modified: *//"
- fi
- done
-
- cd ${CURRENT_DIR}
-
- echo "Visited ${NB_SUBDIR} directories."
-}
-
-function vcup () {
- if [[ "$1" ]]; then
- CURRENT=${PWD}
- while [[ "$1" ]]; do
- cd ${CURRENT}
- cd $1
- if [[ -d ".git" ]]; then
- echo "${PWD} is under GIT"
- git pull
- elif [[ -d ".svn" ]]; then
- echo "${PWD} is under SVN"
- svn update
- else
- echo "No known versioning system."
- fi
- shift
- done
- cd ${CURRENT}
- else
- vcup .
- fi
-}
-
-######################################################################
-# Downloads torrents located in ${BT_DIR}/torrents/ and puts the
-# result in the ${BT_DIR}
-
-function bt () {
- if [[ ${BT_DIR} ]]; then
- if [[ -d "${BT_DIR}/torrents" ]]; then
- if [[ "$1" ]]; then
- mv "$1" ${BT_DIR}/torrents
- fi
- if [[ "$(ps auxwww | grep btlaunchmanycurses | grep -v grep)" ]]; then
- echo "A client is already running."
- else
- cd ${BT_DIR} && screen btlaunchmanycurses torrents --max_upload_rate 32
- fi
- else
- echo "Directory ${BT_DIR}/torrents does not exist."
- fi
- else
- echo "You have to set \$BT_DIR."
- fi
-}
-