|
@@ -0,0 +1,27 @@
|
|
1
|
+#!/usr/bin/env bash
|
|
2
|
+#
|
|
3
|
+# mffp
|
|
4
|
+#
|
|
5
|
+# Push the given commit (or HEAD) upstream immediately.
|
|
6
|
+# By default: `git push upstream HEAD:bugfix-1.1.x`
|
|
7
|
+#
|
|
8
|
+
|
|
9
|
+[[ $# < 3 ]] || { echo "Usage: `basename $0` [1|2] [commit-id]" 1>&2 ; exit 1; }
|
|
10
|
+
|
|
11
|
+if [[ $1 == '1' || $1 == '2' ]]; then
|
|
12
|
+ MFINFO=$(mfinfo "$1") || exit 1
|
|
13
|
+ REF=${2:-HEAD}
|
|
14
|
+else
|
|
15
|
+ MFINFO=$(mfinfo) || exit 1
|
|
16
|
+ REF=${1:-HEAD}
|
|
17
|
+fi
|
|
18
|
+
|
|
19
|
+IFS=' ' read -a INFO <<< "$MFINFO"
|
|
20
|
+ORG=${INFO[0]}
|
|
21
|
+TARG=${INFO[3]}
|
|
22
|
+
|
|
23
|
+if [[ $ORG == "MarlinFirmware" ]]; then
|
|
24
|
+ git push upstream $REF:$TARG
|
|
25
|
+else
|
|
26
|
+ echo "Not a MarlinFirmware working copy."; exit 1
|
|
27
|
+fi
|