git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: pasky@suse.cz
To: git@vger.kernel.org
Cc: spearce@spearce.org
Subject: [PATCH 2/3] git-gui: Use git web--browse --stdin for safe URL passing
Date: Thu, 25 Sep 2008 01:57:36 +0200	[thread overview]
Message-ID: <20080925000156.857197915@suse.cz> (raw)
In-Reply-To: 20080924235734.697978308@suse.cz

[-- Attachment #1: t/git-gui/web-browse-stdin.diff --]
[-- Type: text/plain, Size: 972 bytes --]

The current code does not actually require this since the documentation
URL should always pass through unmangled, but future users of
start_browser() (as in the patch to follow) might require this.

This patch has been sponsored by Novartis.

Signed-off-by: Petr Baudis <pasky@suse.cz>

---
 git-gui/git-gui.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index fc67eb8..4d2d600 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2360,7 +2360,11 @@ if {[file isfile $doc_path]} {
 }
 
 proc start_browser {url} {
-	git "web--browse" $url
+	# We use --stdin here since passing URLs (especially with query
+	# strings) does insane things in MSysGit.
+	set fd [git_write "web--browse" "--stdin"]
+	puts $fd $url
+	close $fd
 }
 
 .mbar.help add command -label [mc "Online Documentation"] \
-- 
tg: (6e32399..) t/git-gui/web-browse-stdin (depends on: t/git-gui/web-browse t/web--browse/stdin)

  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 ` [PATCH 1/3] git web--browse: Add --stdin option support pasky
2008-09-24 23:57 ` pasky [this message]
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.857197915@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).