diff options
author | Georgiy Bondarenko <69736697+nehilo@users.noreply.github.com> | 2021-03-04 20:54:23 +0300 |
---|---|---|
committer | Georgiy Bondarenko <69736697+nehilo@users.noreply.github.com> | 2021-03-04 20:54:23 +0300 |
commit | e8701195e66f2d27ffe17fb514eae8173795aaf7 (patch) | |
tree | 9f519c4abf6556b9ae7190a6210d87ead1dfadde /buildroot/share/git/mffp | |
download | kp3s-lgvl-e8701195e66f2d27ffe17fb514eae8173795aaf7.tar.xz kp3s-lgvl-e8701195e66f2d27ffe17fb514eae8173795aaf7.zip |
Initial commit
Diffstat (limited to 'buildroot/share/git/mffp')
-rw-r--r-- | buildroot/share/git/mffp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/buildroot/share/git/mffp b/buildroot/share/git/mffp new file mode 100644 index 0000000..2663a4a --- /dev/null +++ b/buildroot/share/git/mffp @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# 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|3] [commit-id]" 1>&2 ; exit 1; } + +if [[ $1 == '1' || $1 == '2' || $1 == '3' ]]; 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 |