Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 22 lines (15 sloc) 509 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
my $issue = shift @ARGV;
my $host = qx{git config --get hub.host} || "github.com";
chomp $host;
my ($remote_url) = qx{git config --get remote.origin.url};
chomp $remote_url;
my ($user, $repo) = $remote_url =~ qr{[:/]([^/]+)/([^/]+?)(?:[.]git)?$};
unless ($issue) {
my $branch = qx{git symbolic-ref HEAD 2> /dev/null};
($issue) = $branch =~ m{(\d+)};
}
die "please specify issue" unless $issue;
system "open https://$host/$user/$repo/issues/$issue";