shift
declare file="${1:?Args 1: file is missing}"
+ declare fmt='>>\n>> %s\n>>\n'
#
# Commit
#
declare comment
if [ -n "$(git status --porcelain "$file")" ]
then
- echo -e ">> COMMIT\n"
+ printf "$fmt" "COMMIT"
declare default="${file##$(git_root)/}"
read -e -p "Your comment: " -i "$default" comment
if [ -z "$comment" ]
#
# Push
#
- echo -e ">> PUSH\n"
+ printf "$fmt" "PUSH"
git push
#
then
case "$(git_branch)" in
master)
- echo -e ">> MERGE TO testing\n"
+ printf "$fmt" "MERGE TO testing"
git branch | grep ' testing$' && git_merge_to testing
;;
testing)
- echo -e ">> MERGE TO master\n"
+ printf "$fmt" "MERGE TO master"
git_merge_to master
;;
esac