1
0
mirror of https://github.com/git/git synced 2024-06-30 22:54:27 +00:00

t: convert fgrep usage to "grep -F"

Despite POSIX states that:

> The old egrep and fgrep commands are likely to be supported for many
> years to come as implementation extensions, allowing historical
> applications to operate unmodified.

GNU grep 3.8 started to warn[1]:

> The egrep and fgrep commands, which have been deprecated since
> release 2.5.3 (2007), now warn that they are obsolescent and should
> be replaced by grep -E and grep -F.

Prepare for their removal in the future.

[1]: https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Đoàn Trần Công Danh 2022-09-21 20:02:32 +07:00 committed by Junio C Hamano
parent 81580fa06d
commit 37eb90f79a
6 changed files with 16 additions and 16 deletions

View File

@ -291,7 +291,7 @@ test_expect_success BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" '
git reset --hard &&
touch fo\[ou\]bar foobar &&
git add '\''fo\[ou\]bar'\'' &&
git ls-files fo\[ou\]bar | fgrep fo\[ou\]bar &&
git ls-files fo\[ou\]bar | grep -F fo\[ou\]bar &&
! ( git ls-files foobar | grep foobar )
'

View File

@ -49,7 +49,7 @@ test_expect_success 'result is really identical' '
test_expect_success 'rewrite bare repository identically' '
(git config core.bare true && cd .git &&
git filter-branch branch > filter-output 2>&1 &&
! fgrep fatal filter-output)
! grep fatal filter-output)
'
git config core.bare false
test_expect_success 'result is really identical' '
@ -506,7 +506,7 @@ test_expect_success 'rewrite repository including refs that point at non-commit
git tag -a -m "tag to a tree" treetag $new_tree &&
git reset --hard HEAD &&
git filter-branch -f -- --all >filter-output 2>&1 &&
! fgrep fatal filter-output
! grep fatal filter-output
'
test_expect_success 'filter-branch handles ref deletion' '

View File

@ -35,7 +35,7 @@ test_expect_success 'SVN-side change outside of .git' '
echo b >> a &&
svn_cmd commit -m "SVN-side change outside of .git" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change outside of .git"
svn_cmd log -v | grep -F "SVN-side change outside of .git"
)
'
@ -59,7 +59,7 @@ test_expect_success 'SVN-side change inside of .git' '
svn_cmd add --force .git &&
svn_cmd commit -m "SVN-side change inside of .git" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change inside of .git"
svn_cmd log -v | grep -F "SVN-side change inside of .git"
)
'
@ -82,7 +82,7 @@ test_expect_success 'SVN-side change in and out of .git' '
git commit -m "add a inside an SVN repo" &&
svn_cmd commit -m "SVN-side change in and out of .git" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change in and out of .git"
svn_cmd log -v | grep -F "SVN-side change in and out of .git"
)
'

View File

@ -43,7 +43,7 @@ test_expect_success 'init+fetch an SVN repository with ignored www directory' '
test_expect_success 'verify ignore-paths config saved by clone' '
(
cd g &&
git config --get svn-remote.svn.ignore-paths | fgrep "www"
git config --get svn-remote.svn.ignore-paths | grep www
)
'
@ -53,7 +53,7 @@ test_expect_success 'SVN-side change outside of www' '
echo b >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change outside of www" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change outside of www"
svn_cmd log -v | grep "SVN-side change outside of www"
)
'
@ -85,7 +85,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
echo zaq >> www/test_www.txt &&
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
svn_cmd log -v | grep -F "SVN-side change inside of www/test_www.txt"
)
'
@ -118,7 +118,7 @@ test_expect_success 'SVN-side change in and out of ignored www' '
echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
svn_cmd log -v | grep "SVN-side change in and out of ignored www"
)
'

View File

@ -43,7 +43,7 @@ test_expect_success 'fetch fails on modified hidden file' '
git svn find-rev refs/remotes/git-svn > ../expect &&
test_must_fail git svn fetch 2> ../errors &&
git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
fgrep "not found in commit" errors &&
grep "not found in commit" errors &&
test_cmp expect expect2
'
@ -59,7 +59,7 @@ test_expect_success 'refetch succeeds not ignoring any files' '
( cd g &&
git svn fetch &&
git svn rebase &&
fgrep "mod hidden" hid/hid.txt
grep "mod hidden" hid/hid.txt
)
'

View File

@ -45,7 +45,7 @@ test_expect_success 'init+fetch an SVN repository with included qqq directory' '
test_expect_success 'verify include-paths config saved by clone' '
(
cd g &&
git config --get svn-remote.svn.include-paths | fgrep "qqq"
git config --get svn-remote.svn.include-paths | grep qqq
)
'
@ -55,7 +55,7 @@ test_expect_success 'SVN-side change outside of www' '
echo b >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change outside of www" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change outside of www"
svn_cmd log -v | grep "SVN-side change outside of www"
)
'
@ -87,7 +87,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
echo zaq >> www/test_www.txt &&
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
svn_cmd log -v | grep "SVN-side change inside of www/test_www.txt"
)
'
@ -120,7 +120,7 @@ test_expect_success 'SVN-side change in and out of included qqq' '
echo ygg >> qqq/test_qqq.txt &&
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
svn_cmd up &&
svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
svn_cmd log -v | grep "SVN-side change in and out of ignored www"
)
'