Thread (7 messages) flat view 7 messages, 3 authors, 2016-06-15
DORMANTno replies

[PATCH 1/3] git web--browse: Add --stdin option support

From: <hidden>
Date: 2016-06-15 22:45:24
Subsystem: documentation, the rest · Maintainers: Jonathan Corbet, Linus Torvalds

This ugly hack seems to be necessary to safely pass URLs containing
query string even in the MinGW environment from TCL (git-gui). I admit
that it is not nice, but I at least did not manage to find any other
way to achieve that even after spending very long time debugging this
mysterious problem.

This patch has been sponsored by Novartis.

Signed-off-by: Petr Baudis <redacted>

---
 Documentation/git-web--browse.txt |    5 ++++-
 git-web--browse.sh                |    6 +++++-
 2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-web--browse.txt b/Documentation/git-web--browse.txt
index 7f7a45b..15d2c25 100644
--- a/Documentation/git-web--browse.txt
+++ b/Documentation/git-web--browse.txt
@@ -7,7 +7,7 @@ git-web--browse - git helper script to launch a web browser
 
 SYNOPSIS
 --------
-'git web--browse' [OPTIONS] URL/FILE ...
+'git web--browse' [OPTIONS] {--stdin,URL/FILE...}
 
 DESCRIPTION
 -----------
@@ -45,6 +45,9 @@ OPTIONS
 	CONF.VAR is looked up in the git config files. If it's set,
 	then its value specify the browser that should be used.
 
+--stdin::
+	Read the location to open from stdin.
+
 CONFIGURATION VARIABLES
 -----------------------
 
diff --git a/git-web--browse.sh b/git-web--browse.sh
index 384148a..68234fa 100755
--- a/git-web--browse.sh
+++ b/git-web--browse.sh
@@ -16,7 +16,7 @@
 # git maintainer.
 #
 
-USAGE='[--browser=browser|--tool=browser] [--config=conf.var] url/file ...'
+USAGE='[--browser=browser|--tool=browser] [--config=conf.var] {--stdin,url/file...}'
 
 # This must be capable of running outside of git directory, so
 # the vanilla git-sh-setup should not be used.
@@ -71,6 +71,10 @@ do
 		    shift ;;
 	    esac
 	    ;;
+	--stdin*)
+	    shift
+	    set "$(cat)"
+	    break ;;
 	--)
 	    break
 	    ;;
-- 
tg: (c427559..) t/web--browse/stdin (depends on: vanilla/master)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help