Update git helper usage
This commit is contained in:
parent
31679640c0
commit
a484adcb30
@ -1,14 +1,14 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# mffp [1|2] [commit-id]
|
# mffp [1|2|3] [commit-id]
|
||||||
#
|
#
|
||||||
# Push the given commit (or HEAD) upstream immediately.
|
# Push the given commit (or HEAD) upstream immediately.
|
||||||
# By default: `git push upstream HEAD:bugfix-1.1.x`
|
# 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
|
MFINFO=$(mfinfo "$1") || exit 1
|
||||||
REF=${2:-HEAD}
|
REF=${2:-HEAD}
|
||||||
else
|
else
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
usage() {
|
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; }
|
[[ $# < 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
|
# BRANCH can be given as the last argument
|
||||||
case "$#" in
|
case "$#" in
|
||||||
1 ) case "$1" in
|
1 ) case "$1" in
|
||||||
1|2) ;;
|
1|2|3) ;;
|
||||||
*) BRANCH=$1 ;;
|
*) BRANCH=$1 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
2 ) case "$1" in
|
2 ) case "$1" in
|
||||||
1|2) BRANCH=$2 ;;
|
1|2|3) BRANCH=$2 ;;
|
||||||
*) usage ; exit 1 ;;
|
*) usage ; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# mfpr [1|2]
|
# mfpr [1|2|3]
|
||||||
#
|
#
|
||||||
# Make a PR against bugfix-1.1.x or bugfix-2.0.x
|
# 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
|
MFINFO=$(mfinfo "$@") || exit 1
|
||||||
IFS=' ' read -a INFO <<< "$MFINFO"
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/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`
|
# Add all changed files, commit as "patch", do `mfrb` and `git push -f`
|
||||||
#
|
#
|
||||||
@ -24,7 +24,7 @@ done
|
|||||||
|
|
||||||
[[ ${INFO[4]} =~ [0-9] ]] && USAGE=1
|
[[ ${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 add .
|
||||||
git commit -m "patch"
|
git commit -m "patch"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# mfrb
|
# 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
|
MFINFO=$(mfinfo "$@") || exit 1
|
||||||
@ -21,7 +21,7 @@ while [ $IND -lt ${#INFO[@]} ]; do
|
|||||||
let IND+=1
|
let IND+=1
|
||||||
done
|
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 the branch isn't currently the PR target
|
||||||
if [[ $TARG != $CURR ]]; then
|
if [[ $TARG != $CURR ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user