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

Re: [PATCH] rebase -p: avoid grep on potentailly non-ASCII data

From
Torsten Bögershausen <tboegi@web.de>
Date
Mar 10, 2016, 07:42 UTC
Message-ID
<56E1256B.9030308@web.de>
In-Reply-To
<xmqqvb4vgzxs.fsf@gitster.mtv.corp.google.com>
On 09.03.16 21:26, Junio C Hamano wrote:
> Anders Kaseorg <andersk@mit.edu> writes:
[]
Show 10 quoted lines
>  sane_grep () {
> -	GREP_OPTIONS= LC_ALL=C grep "$@"
> +	GREP_OPTIONS= LC_ALL=C grep @@SANE_TEXT_GREP@@ "$@"
>  }
>  
>  sane_egrep () {
> -	GREP_OPTIONS= LC_ALL=C egrep "$@"
> +	GREP_OPTIONS= LC_ALL=C egrep @@SANE_TEXT_GREP@@ "$@"
>  }
>

I always wondered why we do LC_ALL=C. Isn't that begging for trouble, when we feed UTF-8, ISO-8895-1 or other stuff into a program and say LC_ALL=C at the same time ?

On my Debian Linux system I have LANG=en_US.UTF-8

and

$ locale -a C C.UTF-8 en_US.utf8 POSIX --------------

Mac OS has LANG unset, and reports locale -a en_US en_US.ISO8859-1 en_US.ISO8859-15 en_US.US-ASCII en_US.UTF-8 #(and a lot more ) C POSIX

----- My Centos has LANG=en_US.UTF-8

and reports e.g. en_US en_US.iso88591 en_US.iso885915 en_US.utf8 (And many more)

In t0204 we have
    LANGUAGE=is LC_ALL="$is_IS_locale" git init repo >actual &&
which is based on
	# is_IS.UTF-8 on Solaris and FreeBSD, is_IS.utf8 on Debian
	is_IS_locale=$(locale -a 2>/dev/null |
in 
lib-gettext.sh
Is there something we can steal here ?
http://pubs.opengroup.org/onlinepubs/007908799/xbd/envvar.html
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 12 in “rebase -p: avoid grep on potentailly non-ASCII data”
  1. rebase -p: avoid grep on potentailly non-ASCII dataAnders Kaseorg, Mar 8, 2016
  2. Torsten BögershausenMar 8, 2016
  3. Michael J GruberMar 8, 2016
  4. Jeff KingMar 8, 2016
  5. Junio C HamanoMar 8, 2016
  6. Junio C HamanoMar 8, 2016
  7. Jeff KingMar 9, 2016
  8. Jeff KingMar 9, 2016
  9. Anders KaseorgMar 9, 2016
  10. Junio C HamanoMar 9, 2016
  11. Torsten BögershausenMar 10, 2016
  12. Junio C HamanoMar 10, 2016

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.