Browse Source

Update "firstpush" to open branch commits on Github

Scott Lahteine 8 years ago
parent
commit
396bd7b377
1 changed files with 24 additions and 1 deletions
  1. 24
    1
      buildroot/share/git/firstpush

+ 24
- 1
buildroot/share/git/firstpush View File

@@ -1,3 +1,26 @@
1 1
 #!/usr/bin/env bash
2
+#
3
+# firstpush
4
+#
5
+# Push a branch to 'origin' and open the
6
+# commit log to watch Travis CI progress.
7
+#
2 8
 
3
-git push --set-upstream origin `git branch | grep \* | sed 's/\* //g'`
9
+MFINFO=$(mfinfo) || exit
10
+IFS=' ' read -a INFO <<< "$MFINFO"
11
+FORK=${INFO[1]}
12
+REPO=${INFO[2]}
13
+BRANCH=${INFO[4]}
14
+
15
+git push --set-upstream origin $BRANCH
16
+
17
+TOOL=$(which gnome-open xdg-open open | awk '{ print $1 }')
18
+URL="https://github.com/$FORK/$REPO/commits/$BRANCH"
19
+
20
+if [ -z "$TOOL" ]; then
21
+  echo "Can't find a tool to open the URL:"
22
+  echo $URL
23
+else
24
+  echo "Viewing commits on $BRANCH..."
25
+  "$TOOL" "$URL"
26
+fi

Loading…
Cancel
Save