summaryrefslogtreecommitdiff
path: root/bin/git-mr
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-11-09 09:29:35 -0700
committerSean Whitton <spwhitton@spwhitton.name>2019-11-09 10:58:23 -0700
commitaabb20fa10c487ba47177570dbaf7dcecb431226 (patch)
treebc0ff80f5db0fdf0d9fab89232cc256da4f1e5fb /bin/git-mr
parenta28261e4fcab8cd1218f7ea516c7a440f77c3eaa (diff)
downloaddotfiles-aabb20fa10c487ba47177570dbaf7dcecb431226.tar.gz
git-mr with more helpful error msg when I don't supply all the args
Diffstat (limited to 'bin/git-mr')
-rwxr-xr-xbin/git-mr10
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/git-mr b/bin/git-mr
new file mode 100755
index 00000000..a71f50eb
--- /dev/null
+++ b/bin/git-mr
@@ -0,0 +1,10 @@
+#!/usr/bin/perl
+
+use 5.028;
+use strict;
+use warnings;
+
+die "usage: git mr REMOTE_NAME MERGE_REQUEST_ID BRANCH_NAME\n"
+ unless @ARGV == 3;
+system "git fetch $ARGV[0] merge-requests/$ARGV[1]/head";
+system "git checkout -b mr/$ARGV[2] FETCH_HEAD";