summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c33912a)
raw | patch | inline | side by side (parent: c33912a)
author | Jeff King <peff@peff.net> | |
Tue, 30 Sep 2008 08:03:55 +0000 (04:03 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Tue, 30 Sep 2008 19:39:58 +0000 (12:39 -0700) |
We try to avoid using the "-q" or "-e" options, as they are
largely useless, as explained in aadbe44f.
There is one exception for "-e" here, which is in t7701 used
to produce an "or" of patterns. This can be rewritten as an
egrep pattern.
This patch also removes use of "grep -F" in favor of the
more widely available "fgrep".
[sp: Tested on AIX 5.3 by Mike Ralphson,
Tested on MinGW by Johannes Sixt]
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
largely useless, as explained in aadbe44f.
There is one exception for "-e" here, which is in t7701 used
to produce an "or" of patterns. This can be rewritten as an
egrep pattern.
This patch also removes use of "grep -F" in favor of the
more widely available "fgrep".
[sp: Tested on AIX 5.3 by Mike Ralphson,
Tested on MinGW by Johannes Sixt]
Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Mike Ralphson <mike@abacus.co.uk>
Tested-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
index 4db4ac44c9611398db46dfbe2688c95e3b03605b..cb144258ccc3f32025c4b7beba6ac02c427612d8 100755 (executable)
--- a/t/t0002-gitfile.sh
+++ b/t/t0002-gitfile.sh
echo "git rev-parse accepted an invalid .git file"
false
fi &&
- if ! grep -qe "Invalid gitfile format" .err
+ if ! grep "Invalid gitfile format" .err
then
echo "git rev-parse returned wrong error"
false
echo "git rev-parse accepted an invalid .git file path"
false
fi &&
- if ! grep -qe "Not a git repository" .err
+ if ! grep "Not a git repository" .err
then
echo "git rev-parse returned wrong error"
false
diff --git a/t/t1501-worktree.sh b/t/t1501-worktree.sh
index c039ee3fd86fc30a551a301066528a8574c34c1e..f6a6f839a18de4c3775ea965f164d0d20f2bbe9b 100755 (executable)
--- a/t/t1501-worktree.sh
+++ b/t/t1501-worktree.sh
test_expect_success 'git grep' '
(cd repo.git/work/sub &&
- GIT_DIR=../.. GIT_WORK_TREE=.. git grep -l changed | grep -q dir/tracked)
+ GIT_DIR=../.. GIT_WORK_TREE=.. git grep -l changed | grep dir/tracked)
'
test_done
diff --git a/t/t3700-add.sh b/t/t3700-add.sh
index 2ac93a346d016c65614f2bf6142049e7bdc39bd1..9f6454d2ffa22ef8a207b1a4e5e2ba156e84cdb9 100755 (executable)
--- a/t/t3700-add.sh
+++ b/t/t3700-add.sh
git reset --hard &&
touch fo\[ou\]bar foobar &&
git add '\''fo\[ou\]bar'\'' &&
- git ls-files fo\[ou\]bar | grep -F fo\[ou\]bar &&
+ git ls-files fo\[ou\]bar | fgrep fo\[ou\]bar &&
! ( git ls-files foobar | grep foobar )
'
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index 1be5fb3f9dfab6d4fcd79f65de6b85ae05f373cd..796f795267dee1eaf63b10fb3e5e14ce0431bebd 100755 (executable)
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
git am --keep patch4 &&
! test -d .git/rebase-apply &&
git cat-file commit HEAD |
- grep -q -F "Re: Re: Re: [PATCH 1/5 v2] third"
+ fgrep "Re: Re: Re: [PATCH 1/5 v2] third"
'
test_expect_success 'am -3 falls back to 3-way merge' '
index aac212e936331db9a596fda0c4a9c0382e123797..ba9060190d31f0b57a461c114e1c856523845f78 100755 (executable)
--- a/t/t6040-tracking-info.sh
+++ b/t/t6040-tracking-info.sh
(
cd test && git checkout b1
) >actual &&
- grep -e "have 1 and 1 different" actual
+ grep "have 1 and 1 different" actual
'
test_expect_success 'status' '
# reports nothing to commit
test_must_fail git status
) >actual &&
- grep -e "have 1 and 1 different" actual
+ grep "have 1 and 1 different" actual
'
diff --git a/t/t7002-grep.sh b/t/t7002-grep.sh
index 5e359cb561b6d6f7c1bae678b7b823ed2ce34cf1..18fe6f2d576d35706b1a712292b58155680cc9dc 100755 (executable)
--- a/t/t7002-grep.sh
+++ b/t/t7002-grep.sh
'
test_expect_success "grep -c $L (no /dev/null)" '
- ! git grep -c test $H | grep -q /dev/null
+ ! git grep -c test $H | grep /dev/null
'
done
index 531dac060a761f3383b3bee15444345a66e2f13b..b48046e2614fa3926b49a7c5cb379d7f6359e881 100755 (executable)
git repack -A -d -l &&
# verify objects are packed in repository
test 3 = $(git verify-pack -v -- .git/objects/pack/*.idx |
- grep -e "^$fsha1 " -e "^$csha1 " -e "^$tsha1 " |
+ egrep "^($fsha1|$csha1|$tsha1) " |
sort | uniq | wc -l) &&
git show $fsha1 &&
git show $csha1 &&
git repack -A -d -l &&
# verify objects are retained unpacked
test 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |
- grep -e "^$fsha1 " -e "^$csha1 " -e "^$tsha1 " |
+ egrep "^($fsha1|$csha1|$tsha1) " |
sort | uniq | wc -l) &&
git show $fsha1 &&
git show $csha1 &&
index 46ba19be7da754ffa14321eabac9ba0a985e6d94..07117a8b7d9cdd95ebf013e11b9474667ac0bfd3 100755 (executable)
rm -f gitweb.log &&
perl -- "$TEST_DIRECTORY/../gitweb/gitweb.perl" \
>/dev/null 2>gitweb.log &&
- if grep -q -s "^[[]" gitweb.log >/dev/null; then false; else true; fi
+ if grep "^[[]" gitweb.log >/dev/null 2>&1; then false; else true; fi
# gitweb.log is left for debugging
}