From: pasky@suse.cz
To: git@vger.kernel.org
Cc: spearce@spearce.org
Subject: [PATCH 1/3] git web--browse: Add --stdin option support
Date: Thu, 25 Sep 2008 01:57:35 +0200 [thread overview]
Message-ID: <20080925000156.372683193@suse.cz> (raw)
In-Reply-To: 20080924235734.697978308@suse.cz
[-- Attachment #1: t/web--browse/stdin.diff --]
[-- Type: text/plain, Size: 1868 bytes --]
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)
next prev parent reply other threads:[~2008-09-25 0:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-24 23:57 [PATCH 0/3] [RFC] Support for publishing projects at central site pasky
2008-09-24 23:57 ` pasky [this message]
2008-09-24 23:57 ` [PATCH 2/3] git-gui: Use git web--browse --stdin for safe URL passing pasky
2008-09-24 23:57 ` [PATCH 3/3] [FYI]git-gui: repo.or.cz-ish fork integration pasky
2008-09-25 6:15 ` Andreas Ericsson
2008-09-25 8:56 ` [PATCH 0/3] [RFC] Support for publishing projects at central site Peter Krefting
2008-09-25 10:24 ` Petr Baudis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080925000156.372683193@suse.cz \
--to=pasky@suse.cz \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).