From 88ce0da6d87944278b464c45b8b53a73042bdd04 Mon Sep 17 00:00:00 2001 From: David O'Trakoun Date: Sat, 9 May 2015 01:26:44 -0400 Subject: [PATCH 1/2] portability updates - use user specified BROWSER if available, use user's env set bash (e.g. if they use brew bash instead of OSX bash) --- git-open | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-open b/git-open index 9df3c95..23df3dd 100755 --- a/git-open +++ b/git-open @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Opens the github page for a repo/branch in your browser. # https://github.com/paulirish/git-open/ @@ -97,7 +97,7 @@ case $( uname -s ) in Darwin) open=open;; MINGW*) open=start;; CYGWIN*) open=cygstart;; - *) open=xdg-open;; + *) open=${BROWSER:-xdg-open};; esac # open it in a browser From b62ca9a09f9417d4f345d2e85e9befd6922b861e Mon Sep 17 00:00:00 2001 From: David O'Trakoun Date: Sat, 9 May 2015 01:31:24 -0400 Subject: [PATCH 2/2] open src to current path --- git-open | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git-open b/git-open index 23df3dd..ad8806b 100755 --- a/git-open +++ b/git-open @@ -56,7 +56,9 @@ elif grep -q github <<<$giturl; then # bitbucket elif grep -q bitbucket <<<$giturl; then giturl=${giturl/git\@bitbucket\.org\:/https://bitbucket.org/} - providerUrlDifference="src" + rev="$(git rev-parse HEAD)" + git_pwd="$(git rev-parse --show-prefix)" + providerUrlDifference="src/${rev}/${git_pwd}" branch="?at=${branch}" # Atlassian Stash