Update git helper usage
This commit is contained in:
parent
31679640c0
commit
a484adcb30
|
@ -1,14 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# mffp [1|2] [commit-id]
|
||||
# mffp [1|2|3] [commit-id]
|
||||
#
|
||||
# Push the given commit (or HEAD) upstream immediately.
|
||||
# By default: `git push upstream HEAD:bugfix-1.1.x`
|
||||
#
|
||||
|
||||
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2] [commit-id]" 1>&2 ; exit 1; }
|
||||
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2|3] [commit-id]" 1>&2 ; exit 1; }
|
||||
|
||||
if [[ $1 == '1' || $1 == '2' ]]; then
|
||||
if [[ $1 == '1' || $1 == '2' || $1 == '3' ]]; then
|
||||
MFINFO=$(mfinfo "$1") || exit 1
|
||||
REF=${2:-HEAD}
|
||||
else
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
|
||||
usage() {
|
||||
echo "usage: `basename $0` [1|2] [name]" 1>&2
|
||||
echo "usage: `basename $0` [1|2|3] [name]" 1>&2
|
||||
}
|
||||
|
||||
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { usage; exit 1; }
|
||||
|
@ -19,12 +19,12 @@ BRANCH=pr_for_$TARG-$(date +"%G-%m-%d_%H.%M.%S")
|
|||
# BRANCH can be given as the last argument
|
||||
case "$#" in
|
||||
1 ) case "$1" in
|
||||
1|2) ;;
|
||||
1|2|3) ;;
|
||||
*) BRANCH=$1 ;;
|
||||
esac
|
||||
;;
|
||||
2 ) case "$1" in
|
||||
1|2) BRANCH=$2 ;;
|
||||
1|2|3) BRANCH=$2 ;;
|
||||
*) usage ; exit 1 ;;
|
||||
esac
|
||||
;;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# mfpr [1|2]
|
||||
# mfpr [1|2|3]
|
||||
#
|
||||
# Make a PR against bugfix-1.1.x or bugfix-2.0.x
|
||||
#
|
||||
|
||||
[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [branch]" 1>&2 ; exit 1; }
|
||||
[[ $# < 2 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2|3] [branch]" 1>&2 ; exit 1; }
|
||||
|
||||
MFINFO=$(mfinfo "$@") || exit 1
|
||||
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# mfqp [-q|--quick] [1|2]
|
||||
# mfqp [-q|--quick] [1|2|3]
|
||||
#
|
||||
# Add all changed files, commit as "patch", do `mfrb` and `git push -f`
|
||||
#
|
||||
|
@ -24,7 +24,7 @@ done
|
|||
|
||||
[[ ${INFO[4]} =~ [0-9] ]] && USAGE=1
|
||||
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [-hq] [1|2]" 1>&2 ; exit 1 ; }
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [-hq] [1|2|3]" 1>&2 ; exit 1 ; }
|
||||
|
||||
git add .
|
||||
git commit -m "patch"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# mfrb
|
||||
#
|
||||
# Do "git rebase -i" against the "target" branch (bugfix-1.1.x, bugfix-2.0.x, or master)
|
||||
# Do "git rebase -i" against the "target" branch (bugfix-1.1.x, bugfix-2.0.x, dev-2.1.x, or master)
|
||||
#
|
||||
|
||||
MFINFO=$(mfinfo "$@") || exit 1
|
||||
|
@ -21,7 +21,7 @@ while [ $IND -lt ${#INFO[@]} ]; do
|
|||
let IND+=1
|
||||
done
|
||||
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2]" 1>&2 ; exit 1 ; }
|
||||
[[ $USAGE == 1 ]] && { echo "usage: `basename $0` [1|2|3]" 1>&2 ; exit 1 ; }
|
||||
|
||||
# If the branch isn't currently the PR target
|
||||
if [[ $TARG != $CURR ]]; then
|
||||
|
|
Loading…
Reference in a new issue