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

Re: [PATCHv3 5/6] web--browse: use *www-browser if available

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2010, 23:36 UTC
Message-ID
<7vaakhnok7.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1291657790-3719-6-git-send-email-giuseppe.bilotta@gmail.com>
Giuseppe Bilotta <giuseppe.bilotta@gmail.com> writes:
Show 9 quoted lines
> +	# if the linked executable doesn't match a browser name we know about,
> +	# look at the version string
> +
> +	# even though most browsers (and applications, in fact) will show their
> +	# name and version on the first line of the --version output, this is
> +	# not true in particular for the KDE apps (e.g. konqueror and kfmclient),
> +	# which display their name and version on the LAST line. So we cannot
> +	# clip the version string at the first line when retrieving it. Rather,
> +	# we keep it whole and then limit it when we know what we're dealing with.

I'd be more worried about the ones that do not understand --version and spawn a new window.

> +	verstring="$("$testexe" --version 2> /dev/null)"
> +	browser="$(echo "$verstring" | head -n 1 | cut -f1 -d' ' | tr A-Z a-z)"
> +	case "$browser" in
> +		mozilla)
What was the first patch in this series about again ;-)?
Show 26 quoted lines
> +			verstring="$(echo "$verstring" | head -n 1)"
> +			browser="$(echo "$verstring" | cut -f2 -d' ' | tr A-Z a-z)"
> +			;;
> +		google)
> +			verstring="$(echo "$verstring" | head -n 1)"
> +			browser="google-chrome"
> +			;;
> +		qt:)
> +			# konqueror, kfmclient or other KDE app
> +			verstring="$(echo "$verstring" | tail -n 1)"
> +			browser="$(echo "$verstring" | cut -f1 -d:)"
> +			;;
> +		*)
> +			verstring="$(echo "$verstring" | head -n 1)"
> +			;;
> +
> +	esac
> +	if valid_tool "$browser" ; then
> +		browser_path="$i"
> +		return 0
> +	fi
> +
> +	echo >&2 "$testexe (detected as $browser) is not a supported browser, skipping"
> +	browser=""
> +	return 1
> +}

Sorry, but I simply do not think it is worth this ugliness to get slight customization between -new-tab, newTab, and nothingness.

Previous: Giuseppe BilottaNext: Giuseppe Bilotta
Message 9 of 13 in “[PATCHv3 0/6] web--browse cleanup and extensions”
  1. Giuseppe BilottaDec 6, 2010
  2. 1/6 web--browse: coding styleGiuseppe Bilotta, Dec 6, 2010
  3. 2/6 web--browse: split valid_tool listGiuseppe Bilotta, Dec 6, 2010
  4. 3/6 web--browse: support opera, seamonkey and elinksGiuseppe Bilotta, Dec 6, 2010
  5. 4/6 web--browse: better support for chromiumGiuseppe Bilotta, Dec 6, 2010
  6. Junio C HamanoDec 7, 2010
  7. Giuseppe BilottaDec 8, 2010
  8. 5/6 web--browse: use *www-browser if availableGiuseppe Bilotta, Dec 6, 2010
  9. Junio C HamanoDec 7, 2010
  10. Giuseppe BilottaDec 8, 2010
  11. 6/6 web--browse: look at the BROWSER env varGiuseppe Bilotta, Dec 6, 2010
  12. Jonathan NiederDec 6, 2010
  13. Giuseppe BilottaDec 6, 2010

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.