All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Junio C Hamano <gitster@pobox.com>, Anders Kaseorg <andersk@mit.edu>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] rebase -p: avoid grep on potentailly non-ASCII data
Date: Thu, 10 Mar 2016 08:42:35 +0100	[thread overview]
Message-ID: <56E1256B.9030308@web.de> (raw)
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:
[]
>  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

  reply	other threads:[~2016-03-10  7:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08  7:59 [PATCH] rebase -p: avoid grep on potentailly non-ASCII data Anders Kaseorg
2016-03-08 12:25 ` Torsten Bögershausen
2016-03-08 13:45   ` Michael J Gruber
2016-03-08 14:35     ` Jeff King
2016-03-08 23:20       ` Junio C Hamano
2016-03-08 23:36         ` Junio C Hamano
2016-03-09  0:11           ` Jeff King
2016-03-09  0:10         ` Jeff King
2016-03-09  2:31         ` Anders Kaseorg
2016-03-09 20:26           ` Junio C Hamano
2016-03-10  7:42             ` Torsten Bögershausen [this message]
2016-03-10 17:22               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E1256B.9030308@web.de \
    --to=tboegi@web.de \
    --cc=andersk@mit.edu \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.