-git)
- case "$2" in
- update|up)
- ## REMOVES ALL UNCOMMITTED CHANGES!
- [ "$3" == "--force" ] && git checkout -f
- git pull
- ;;
- commit|ci)
- shift 2
- git commit $*
-
- [ "$?" -eq "0" ] || exiterror "git commit $* failed."
-
- echo -e "${BOLD}Do you want to push, too? [y/N]${NORMAL}"
- read
- [ -z $REPLY ] && exit 0
- for i in y Y j J; do
- if [ "$i" == "$REPLY" ]; then
- $0 git push
- exit $?
- fi
- done
- exiterror "\"$REPLY\" is not a valid answer."
- ;;
- dist)
- git archive HEAD | gzip -9 > ${SNAME}-${VERSION}.tar.gz
- ;;
- diff|di)
- echo -ne "Make a local diff to last revision"
- git diff HEAD > ipfire-diff-$(date +'%Y-%m-%d-%H:%M').diff
- evaluate 1
- echo "Diff was successfully saved to ipfire-diff-$(date +'%Y-%m-%d-%H:%M').diff"
- git diff --stat
- ;;
- push)
- [ -z $GIT_USER ] && exiterror "You have to setup GIT_USER first."
- GIT_URL="ssh://${GIT_USER}@git.ipfire.org/pub/git/ipfire-2.x"
-
- git push ${GIT_URL} $3
- ;;
- log)
- [ -z $GIT_TAG ] || LAST_TAG=$GIT_TAG
- [ -z $LAST_TAG ] || EXT="$LAST_TAG..HEAD"
-
- git log -n 500 --no-merges --pretty=medium --shortstat $EXT > $BASEDIR/doc/ChangeLog
- ;;
- esac
- ;;