git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
pasky@suse.cz <pasky@suse.cz>
Date
Sep 24, 2008, 23:57 UTC
Message-ID
<20080925000156.372683193@suse.cz>
In-Reply-To
<20080924235734.697978308@suse.cz>

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 <pasky@suse.cz>
---
 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)
Previous: pasky@suse.czNext: pasky@suse.cz
Message 2 of 7 in “[RFC] Support for publishing projects at central site”
  1. 0/3 [RFC] Support for publishing projects at central sitepasky@suse.cz, Sep 24, 2008
  2. 1/3 git web--browse: Add --stdin option supportpasky@suse.cz, Sep 24, 2008
  3. 2/3 git-gui: Use git web--browse --stdin for safe URL passingpasky@suse.cz, Sep 24, 2008
  4. 3/3 [FYI]git-gui: repo.or.cz-ish fork integrationpasky@suse.cz, Sep 24, 2008
  5. Andreas EricssonSep 25, 2008
  6. Peter KreftingSep 25, 2008
  7. Petr BaudisSep 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.