Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 16 lines (11 sloc) 401 Bytes
#!/usr/bin/env perl
use strict;
use warnings;
my $commit = shift @ARGV || "HEAD";
$commit = qx{git rev-parse $commit};
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)?$};
system "open https://$host/$user/$repo/commit/$commit";