Add 'mffp' to quickly push upstream (#9587)
This commit is contained in:
parent
378867d894
commit
47e56afeeb
1 changed files with 27 additions and 0 deletions
27
buildroot/share/git/mffp
Executable file
27
buildroot/share/git/mffp
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# mffp
|
||||||
|
#
|
||||||
|
# Push the given commit (or HEAD) upstream immediately.
|
||||||
|
# By default: `git push upstream HEAD:bugfix-1.1.x`
|
||||||
|
#
|
||||||
|
|
||||||
|
[[ $# < 3 ]] || { echo "Usage: `basename $0` [1|2] [commit-id]" 1>&2 ; exit 1; }
|
||||||
|
|
||||||
|
if [[ $1 == '1' || $1 == '2' ]]; then
|
||||||
|
MFINFO=$(mfinfo "$1") || exit 1
|
||||||
|
REF=${2:-HEAD}
|
||||||
|
else
|
||||||
|
MFINFO=$(mfinfo) || exit 1
|
||||||
|
REF=${1:-HEAD}
|
||||||
|
fi
|
||||||
|
|
||||||
|
IFS=' ' read -a INFO <<< "$MFINFO"
|
||||||
|
ORG=${INFO[0]}
|
||||||
|
TARG=${INFO[3]}
|
||||||
|
|
||||||
|
if [[ $ORG == "MarlinFirmware" ]]; then
|
||||||
|
git push upstream $REF:$TARG
|
||||||
|
else
|
||||||
|
echo "Not a MarlinFirmware working copy."; exit 1
|
||||||
|
fi
|
Reference in a new issue