2017-04-21 02:27:32 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# mfqp
|
|
|
|
#
|
|
|
|
# Add all changed files, commit as "patch", do `mfrb` and `git push -f`
|
|
|
|
#
|
|
|
|
|
|
|
|
MFINFO=$(mfinfo) || exit
|
|
|
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
|
|
|
|
2017-05-07 06:22:45 +00:00
|
|
|
if [[ ${INFO[4]} == "(no" ]]; then
|
|
|
|
echo "Branch is unavailable!" ; exit 1
|
|
|
|
fi
|
|
|
|
|
2017-04-21 02:27:32 +00:00
|
|
|
case "$#" in
|
|
|
|
0 ) ;;
|
|
|
|
* ) echo "Usage: `basename $0`" 1>&2 ; exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
git add * .travis.yml
|
|
|
|
git commit -m "patch"
|
2017-05-07 06:22:45 +00:00
|
|
|
|
|
|
|
if [[ ${INFO[3]} == ${INFO[4]} ]]; then
|
|
|
|
if [[ ${INFO[2]} == "MarlinDocumentation" ]]; then
|
|
|
|
git rebase -i HEAD~2
|
|
|
|
else
|
|
|
|
echo "Don't alter the PR target branch."; exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
mfrb
|
|
|
|
git push -f
|
|
|
|
fi
|