From: Jeff King Date: Sun, 09 Jun 2013 06:12:22 GMT Subject: Re: [PATCH/RFC] git-remote-mediawiki: new tool to preview local changes without pushing Message-ID: <20130609061222.GB8906@sigill.intra.peff.net> In-Reply-To: On Sat, Jun 08, 2013 at 09:00:30PM +0200, Matthieu Moy wrote: > > + # Auto-loading in browser > > + if ($autoload) { > > + open(my $browser, "-|:encoding(UTF-8)", "xdg-open ".$preview_file_name); > > That could be read from Git's configuration, and default to xdg-open. > But you don't want to hardcode it in the middle of the code. In fact, I think we provide the "git-web--browse" tool for just this purpose. It takes care of the trickiness of looking at the "web.browser" config, resolving custom browser tools defined by "browser..*", and handling backgrounding of the browser (which you want to do for graphical browsers but not for terminal ones). -Peff PS I agreed with all of the other comments in your review. :)