You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
633 B
Plaintext
28 lines
633 B
Plaintext
7 years ago
|
#!/usr/bin/env bash
|
||
|
#
|
||
5 years ago
|
# mffp [1|2|3] [commit-id]
|
||
7 years ago
|
#
|
||
|
# Push the given commit (or HEAD) upstream immediately.
|
||
|
# By default: `git push upstream HEAD:bugfix-1.1.x`
|
||
|
#
|
||
|
|
||
5 years ago
|
[[ $# < 3 && $1 != "-h" && $1 != "--help" ]] || { echo "usage: `basename $0` [1|2|3] [commit-id]" 1>&2 ; exit 1; }
|
||
7 years ago
|
|
||
5 years ago
|
if [[ $1 == '1' || $1 == '2' || $1 == '3' ]]; then
|
||
7 years ago
|
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
|