Re: [PATCH/RFC] git-remote-mediawiki: new tool to preview local changes without pushing
- From
Jeff King <peff@peff.net>
- Date
- Jun 9, 2013, 06:12 UTC
- Message-ID
- <20130609061222.GB8906@sigill.intra.peff.net>
- In-Reply-To
- <vpqzjv0tokx.fsf@anie.imag.fr>
On Sat, Jun 08, 2013 at 09:00:30PM +0200, Matthieu Moy wrote:
Show 6 quoted lines
> > + # 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.<tool>.*", 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. :)