#! /bin/sh
+if [ "x$1" = x-p ]; then
+ private="-p"
+ shift
+fi
+
if [ $# -ne 1 ]; then
- echo "Usage: git open url_key" >&2
+ echo "Usage: git open [-p] url_key" >&2
exit 1
fi
browser_section="`git config --get web.browser`"
browser_cmd="`git config --get browser.\"$browser_section\".cmd`"
-if [ -z "$browser_cmd" ]; then
+if [ x"$private" = x-p ]; then
+ browser_cmd="webbrowser -p"
+elif [ -z "$browser_cmd" ]; then
browser_cmd="webbrowser -n"
fi
#! /bin/sh
+if [ "x$1" = x-p ]; then
+ private="-p"
+ shift
+fi
+
if [ -z "$1" ]; then
branch="`git rev-parse --abbrev-ref HEAD`"
remote="`git config --get branch.$branch.remote`"
exit 1
fi
-exec git-open remote.$remote.url
+exec git-open $private remote.$remote.url