Skip to content

Commit 37eb90f

Browse files
sgngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 81580fa commit 37eb90f

6 files changed

+16
-16
lines changed

t/t3700-add.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ test_expect_success BSLASHPSPEC "git add 'fo\\[ou\\]bar' ignores foobar" '
291291
git reset --hard &&
292292
touch fo\[ou\]bar foobar &&
293293
git add '\''fo\[ou\]bar'\'' &&
294-
git ls-files fo\[ou\]bar | fgrep fo\[ou\]bar &&
294+
git ls-files fo\[ou\]bar | grep -F fo\[ou\]bar &&
295295
! ( git ls-files foobar | grep foobar )
296296
'
297297

t/t7003-filter-branch.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test_expect_success 'result is really identical' '
4949
test_expect_success 'rewrite bare repository identically' '
5050
(git config core.bare true && cd .git &&
5151
git filter-branch branch > filter-output 2>&1 &&
52-
! fgrep fatal filter-output)
52+
! grep fatal filter-output)
5353
'
5454
git config core.bare false
5555
test_expect_success 'result is really identical' '
@@ -506,7 +506,7 @@ test_expect_success 'rewrite repository including refs that point at non-commit
506506
git tag -a -m "tag to a tree" treetag $new_tree &&
507507
git reset --hard HEAD &&
508508
git filter-branch -f -- --all >filter-output 2>&1 &&
509-
! fgrep fatal filter-output
509+
! grep fatal filter-output
510510
'
511511

512512
test_expect_success 'filter-branch handles ref deletion' '

t/t9133-git-svn-nested-git-repo.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test_expect_success 'SVN-side change outside of .git' '
3535
echo b >> a &&
3636
svn_cmd commit -m "SVN-side change outside of .git" &&
3737
svn_cmd up &&
38-
svn_cmd log -v | fgrep "SVN-side change outside of .git"
38+
svn_cmd log -v | grep -F "SVN-side change outside of .git"
3939
)
4040
'
4141

@@ -59,7 +59,7 @@ test_expect_success 'SVN-side change inside of .git' '
5959
svn_cmd add --force .git &&
6060
svn_cmd commit -m "SVN-side change inside of .git" &&
6161
svn_cmd up &&
62-
svn_cmd log -v | fgrep "SVN-side change inside of .git"
62+
svn_cmd log -v | grep -F "SVN-side change inside of .git"
6363
)
6464
'
6565

@@ -82,7 +82,7 @@ test_expect_success 'SVN-side change in and out of .git' '
8282
git commit -m "add a inside an SVN repo" &&
8383
svn_cmd commit -m "SVN-side change in and out of .git" &&
8484
svn_cmd up &&
85-
svn_cmd log -v | fgrep "SVN-side change in and out of .git"
85+
svn_cmd log -v | grep -F "SVN-side change in and out of .git"
8686
)
8787
'
8888

t/t9134-git-svn-ignore-paths.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test_expect_success 'init+fetch an SVN repository with ignored www directory' '
4343
test_expect_success 'verify ignore-paths config saved by clone' '
4444
(
4545
cd g &&
46-
git config --get svn-remote.svn.ignore-paths | fgrep "www"
46+
git config --get svn-remote.svn.ignore-paths | grep www
4747
)
4848
'
4949

@@ -53,7 +53,7 @@ test_expect_success 'SVN-side change outside of www' '
5353
echo b >> qqq/test_qqq.txt &&
5454
svn_cmd commit -m "SVN-side change outside of www" &&
5555
svn_cmd up &&
56-
svn_cmd log -v | fgrep "SVN-side change outside of www"
56+
svn_cmd log -v | grep "SVN-side change outside of www"
5757
)
5858
'
5959

@@ -85,7 +85,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
8585
echo zaq >> www/test_www.txt &&
8686
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
8787
svn_cmd up &&
88-
svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
88+
svn_cmd log -v | grep -F "SVN-side change inside of www/test_www.txt"
8989
)
9090
'
9191

@@ -118,7 +118,7 @@ test_expect_success 'SVN-side change in and out of ignored www' '
118118
echo ygg >> qqq/test_qqq.txt &&
119119
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
120120
svn_cmd up &&
121-
svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
121+
svn_cmd log -v | grep "SVN-side change in and out of ignored www"
122122
)
123123
'
124124

t/t9140-git-svn-reset.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ test_expect_success 'fetch fails on modified hidden file' '
4343
git svn find-rev refs/remotes/git-svn > ../expect &&
4444
test_must_fail git svn fetch 2> ../errors &&
4545
git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
46-
fgrep "not found in commit" errors &&
46+
grep "not found in commit" errors &&
4747
test_cmp expect expect2
4848
'
4949

@@ -59,7 +59,7 @@ test_expect_success 'refetch succeeds not ignoring any files' '
5959
( cd g &&
6060
git svn fetch &&
6161
git svn rebase &&
62-
fgrep "mod hidden" hid/hid.txt
62+
grep "mod hidden" hid/hid.txt
6363
)
6464
'
6565

t/t9147-git-svn-include-paths.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ test_expect_success 'init+fetch an SVN repository with included qqq directory' '
4545
test_expect_success 'verify include-paths config saved by clone' '
4646
(
4747
cd g &&
48-
git config --get svn-remote.svn.include-paths | fgrep "qqq"
48+
git config --get svn-remote.svn.include-paths | grep qqq
4949
)
5050
'
5151

@@ -55,7 +55,7 @@ test_expect_success 'SVN-side change outside of www' '
5555
echo b >> qqq/test_qqq.txt &&
5656
svn_cmd commit -m "SVN-side change outside of www" &&
5757
svn_cmd up &&
58-
svn_cmd log -v | fgrep "SVN-side change outside of www"
58+
svn_cmd log -v | grep "SVN-side change outside of www"
5959
)
6060
'
6161

@@ -87,7 +87,7 @@ test_expect_success 'SVN-side change inside of ignored www' '
8787
echo zaq >> www/test_www.txt &&
8888
svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
8989
svn_cmd up &&
90-
svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
90+
svn_cmd log -v | grep "SVN-side change inside of www/test_www.txt"
9191
)
9292
'
9393

@@ -120,7 +120,7 @@ test_expect_success 'SVN-side change in and out of included qqq' '
120120
echo ygg >> qqq/test_qqq.txt &&
121121
svn_cmd commit -m "SVN-side change in and out of ignored www" &&
122122
svn_cmd up &&
123-
svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
123+
svn_cmd log -v | grep "SVN-side change in and out of ignored www"
124124
)
125125
'
126126

0 commit comments

Comments
 (0)