All of lore.kernel.org
 help / color / mirror / Atom feed
From: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>
To: Junio C Hamano <gitster@pobox.com>
Cc: Carlo Marcelo Arenas Belon <carenas@sajinet.com.pe>,
	Bert Wesarg <bert.wesarg@googlemail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] unset GREP_OPTIONS in test-lib.sh
Date: Tue, 24 Nov 2009 00:59:11 +0100	[thread overview]
Message-ID: <4B0B21CF.5040504@lsrfire.ath.cx> (raw)
In-Reply-To: <7v4ooku7cv.fsf@alter.siamese.dyndns.org>

Junio C Hamano schrieb:
> René Scharfe <rene.scharfe@lsrfire.ath.cx> writes:
> 
>> Yes, but what about git commands that are implemented as shell scripts
>> and use grep?  Something like the following patch?
>>
>> We'd need to run this from time to time to make sure no new grep calls
>> creep in:
>>
>>    git grep -L "unset GREP_OPTIONS" -- $(git grep -l "grep" git-*.sh)
> 
> Hmm, but "bisect run" runs user's script and it may want to see
> GREP_OPTIONS from the environment, no?  Same for any of the hooks that am
> and rebase might want to run.
> 
> 
> 
>  git-sh-setup.sh            |   14 ++++++++++++++
>  git-am.sh                  |    4 ++--
>  git-bisect.sh              |    4 ++--
>  git-filter-branch.sh       |    2 +-
>  git-instaweb.sh            |    8 ++++----
>  git-rebase--interactive.sh |   10 +++++-----
>  git-rebase.sh              |    2 +-
>  git-submodule.sh           |    6 +++---
>  8 files changed, 32 insertions(+), 18 deletions(-)
> 
> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
> index c41c2f7..2b2afa6 100755
> --- a/git-sh-setup.sh
> +++ b/git-sh-setup.sh
> @@ -114,6 +114,20 @@ git_editor() {
>  	eval "${GIT_EDITOR:=vi}" '"$@"'
>  }
>  
> +sane_grep () {
> +	GREP_OPTIONS= \
> +	GREP_COLOR= \
> +	GREP_COLORS= \
> +	LC_ALL=C grep "$@"
> +}
> +
> +sane_egrep () {
> +	GREP_OPTIONS= \
> +	GREP_COLOR= \
> +	GREP_COLORS= \
> +	LC_ALL=C egrep "$@"
> +}
> +

Ah, yes, much nicer.

René

  reply	other threads:[~2009-11-23 23:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 16:15 [PATCH] unset GREP_OPTIONS in test-lib.sh Bert Wesarg
2009-11-18 22:05 ` Junio C Hamano
2009-11-22 15:58   ` René Scharfe
2009-11-23 11:22     ` Carlo Marcelo Arenas Belon
2009-11-23 18:27       ` Junio C Hamano
2009-11-23 23:18         ` René Scharfe
2009-11-23 23:29           ` [PATCH] mergetool--lib: simplify guess_merge_tool() René Scharfe
2009-11-27  3:22             ` David Aguilar
2009-11-23 23:52           ` [PATCH] unset GREP_OPTIONS in test-lib.sh Junio C Hamano
2009-11-23 23:59             ` René Scharfe [this message]
2009-11-24  0:35               ` Junio C Hamano
2010-03-07 10:30   ` Bert Wesarg

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=4B0B21CF.5040504@lsrfire.ath.cx \
    --to=rene.scharfe@lsrfire.ath.cx \
    --cc=bert.wesarg@googlemail.com \
    --cc=carenas@sajinet.com.pe \
    --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.