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

[PATCH 2/3] git-gui: Use git web--browse --stdin for safe URL passing

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

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)
Previous: pasky@suse.czNext: pasky@suse.cz
Message 3 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.