Commit 61ade55f authored by Vincent Driessen's avatar Vincent Driessen

Add initial beginning to the gitflow subcommand infrastructure.

parent 60e07ef5
#!/bin/sh
usage() {
echo "usage: gitflow <start|finish> <btype> <args>"
echo ""
echo "btype can be any of: \"feature\", \"release\", \"hotfix\""
echo ""
}
check_incoming() {
if [ "$ACTION" != "start" -a "$ACTION" != "finish" ]; then
usage
exit 1
fi
if [ "$BTYPE" != "feature" -a "$BTYPE" != "release" -a "$BTYPE" != "hotfix" ]; then
usage
exit 1
fi
}
gitflow_check_clean_working_tree() {
echo "Working tree clean."
}
if [ $# -lt 2 ]; then
usage
exit 1
fi
# Set & check arguments
export GITFLOW_DIR=$(dirname "$0")
ACTION="$1"
BTYPE="$2"
shift 2
check_incoming
# Now, $ACTION and $BTYPE are set
# It's time to call the appropriate subcommand
. "$GITFLOW_DIR/gitflow-sh-setup"
. "$GITFLOW_DIR/gitflow-$BTYPE"
if [ "$ACTION" = "start" ]; then
start "$@"
elif [ "$ACTION" = "finish" ]; then
finish "$@"
else
usage
fi
#!/bin/sh
usage() {
echo "usage: gitflow start hotfix <release>"
echo " gitflow finish hotfix <release>"
}
start() {
# TODO
gitflow_check_clean_working_tree
echo "git checkout -b hotfix-$RELEASE master"
echo "Bump version number"
echo "Fix bug"
}
finish() {
# TODO
gitflow_check_clean_working_tree
echo "git checkout master"
echo "git merge --no-ff hotfix-$RELEASE"
echo "git checkout develop"
echo "git merge --no-ff hotfix-$RELEASE"
echo "git branch -d hotfix-$RELEASE"
}
#!/bin/sh
gitflow_check_clean_working_tree() {
echo "Working tree $(pwd) clean."
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment