{"thread":{"id":"56883","subject":"[PATCH] Makefile, git-sh-setup.sh, t/: do not use `egrep` or `fgrep`","startedAt":"2021-11-12T22:53:39Z","lastAt":"2021-11-12T23:08:24Z","messageCount":2,"participants":["Ville Skyttä","Ævar Arnfjörð Bjarmason"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"441036","messageId":"20211112225334.1862016-1-ville.skytta@iki.fi","threadId":"56883","inReplyTo":null,"subject":"[PATCH] Makefile, git-sh-setup.sh, t/: do not use `egrep` or `fgrep`","fromName":"Ville Skyttä","fromEmail":"ville.skytta@iki.fi","sentAt":"2021-11-12T22:53:34Z","receivedAt":"2021-11-12T22:53:39Z","isPatch":true,"sender":{"key":"ville.skytta@iki.fi","avatar":"https://avatars.githubusercontent.com/u/109152?v=4"},"body":"`egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in\ncurrent post 3.7 Git they have been made to emit obsolescence warnings.\n\n`grep -E` and `grep -F` on the other hand have been in POSIX and its\npredecessors for decades; use them instead, and use basic regular\nexpressions instead of extended ones where applicable.\n\nSigned-off-by: Ville Skyttä <ville.skytta@iki.fi>\n---\n Makefile                             | 2 +-\n git-sh-setup.sh                      | 2 +-\n t/perf/run                           | 4 ++--\n t/t1304-default-acl.sh               | 4 ++--\n t/t3700-add.sh                       | 2 +-\n t/t3702-add-edit.sh                  | 2 +-\n t/t4014-format-patch.sh              | 8 ++++----\n t/t5320-delta-islands.sh             | 2 +-\n t/t7003-filter-branch.sh             | 4 ++--\n t/t7701-repack-unpack-unreachable.sh | 4 ++--\n t/t9001-send-email.sh                | 8 ++++----\n t/t9133-git-svn-nested-git-repo.sh   | 6 +++---\n t/t9134-git-svn-ignore-paths.sh      | 8 ++++----\n t/t9140-git-svn-reset.sh             | 4 ++--\n t/t9147-git-svn-include-paths.sh     | 8 ++++----\n t/t9814-git-p4-rename.sh             | 2 +-\n t/t9815-git-p4-submit-fail.sh        | 4 ++--\n t/test-lib-functions.sh              | 2 +-\n 18 files changed, 38 insertions(+), 38 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 12be39ac49..bef3580155 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -306,7 +306,7 @@ all::\n # Define NO_TCLTK if you do not want Tcl/Tk GUI.\n #\n # Define SANE_TEXT_GREP to \"-a\" if you use recent versions of GNU grep\n-# and egrep that are pickier when their input contains non-ASCII data.\n+# that is pickier when its input contains non-ASCII data.\n #\n # The TCL_PATH variable governs the location of the Tcl interpreter\n # used to optimize git-gui for your system.  Only used if NO_TCLTK\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex 960982f9d5..a479c7b4f0 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -178,7 +178,7 @@ sane_grep () {\n }\n \n sane_egrep () {\n-\tGREP_OPTIONS= LC_ALL=C egrep @@SANE_TEXT_GREP@@ \"$@\"\n+\tGREP_OPTIONS= LC_ALL=C grep -E @@SANE_TEXT_GREP@@ \"$@\"\n }\n \n is_bare_repository () {\ndiff --git a/t/perf/run b/t/perf/run\nindex 55219aa405..e8ac9a9009 100755\n--- a/t/perf/run\n+++ b/t/perf/run\n@@ -229,10 +229,10 @@ then\n \t)\n elif test -n \"$GIT_PERF_SUBSECTION\"\n then\n-\tegrep \"^$GIT_PERF_SUBSECTION\\$\" \"$TEST_RESULTS_DIR\"/run_subsections.names >/dev/null ||\n+\tgrep -E \"^$GIT_PERF_SUBSECTION\\$\" \"$TEST_RESULTS_DIR\"/run_subsections.names >/dev/null ||\n \t\tdie \"subsection '$GIT_PERF_SUBSECTION' not found in '$GIT_PERF_CONFIG_FILE'\"\n \n-\tegrep \"^$GIT_PERF_SUBSECTION\\$\" \"$TEST_RESULTS_DIR\"/run_subsections.names | while read -r subsec\n+\tgrep -E \"^$GIT_PERF_SUBSECTION\\$\" \"$TEST_RESULTS_DIR\"/run_subsections.names | while read -r subsec\n \tdo\n \t\t(\n \t\t\tGIT_PERF_SUBSECTION=\"$subsec\"\ndiff --git a/t/t1304-default-acl.sh b/t/t1304-default-acl.sh\nindex 335d3f3211..c69ae41306 100755\n--- a/t/t1304-default-acl.sh\n+++ b/t/t1304-default-acl.sh\n@@ -18,7 +18,7 @@ test_expect_success 'checking for a working acl setup' '\n \tif setfacl -m d:m:rwx -m u:root:rwx . &&\n \t   getfacl . | grep user:root:rwx &&\n \t   touch should-have-readable-acl &&\n-\t   getfacl should-have-readable-acl | egrep \"mask::?rw-\"\n+\t   getfacl should-have-readable-acl | grep -E \"mask::?rw-\"\n \tthen\n \t\ttest_set_prereq SETFACL\n \tfi\n@@ -34,7 +34,7 @@ check_perms_and_acl () {\n \tgetfacl \"$1\" > actual &&\n \tgrep -q \"user:root:rwx\" actual &&\n \tgrep -q \"user:${LOGNAME}:rwx\" actual &&\n-\tegrep \"mask::?r--\" actual > /dev/null 2>&1 &&\n+\tgrep -E \"mask::?r--\" actual > /dev/null 2>&1 &&\n \tgrep -q \"group::---\" actual || false\n }\n \ndiff --git a/t/t3700-add.sh b/t/t3700-add.sh\nindex 283a66955d..6708d0d319 100755\n--- a/t/t3700-add.sh\n+++ b/t/t3700-add.sh\n@@ -263,7 +263,7 @@ test_expect_success BSLASHPSPEC \"git add 'fo\\\\[ou\\\\]bar' ignores foobar\" '\n \tgit reset --hard &&\n \ttouch fo\\[ou\\]bar foobar &&\n \tgit add '\\''fo\\[ou\\]bar'\\'' &&\n-\tgit ls-files fo\\[ou\\]bar | fgrep fo\\[ou\\]bar &&\n+\tgit ls-files fo\\[ou\\]bar | grep -F fo\\[ou\\]bar &&\n \t! ( git ls-files foobar | grep foobar )\n '\n \ndiff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh\nindex 6c676645d8..7b7d53b443 100755\n--- a/t/t3702-add-edit.sh\n+++ b/t/t3702-add-edit.sh\n@@ -98,7 +98,7 @@ EOF\n \n echo \"#!$SHELL_PATH\" >fake-editor.sh\n cat >> fake-editor.sh <<\\EOF\n-egrep -v '^index' \"$1\" >orig-patch &&\n+grep -v '^index' \"$1\" >orig-patch &&\n mv -f patch \"$1\"\n EOF\n \ndiff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh\nindex 712d4b5ddf..a43161e373 100755\n--- a/t/t4014-format-patch.sh\n+++ b/t/t4014-format-patch.sh\n@@ -1391,7 +1391,7 @@ append_signoff()\n \tC=$(git commit-tree HEAD^^{tree} -p HEAD) &&\n \tgit format-patch --stdout --signoff $C^..$C >append_signoff.patch &&\n \tsed -n -e \"1,/^---$/p\" append_signoff.patch |\n-\t\tegrep -n \"^Subject|Sign|^$\"\n+\t\tgrep -En \"^Subject|Sign|^$\"\n }\n \n test_expect_success 'signoff: commit with no body' '\n@@ -2208,10 +2208,10 @@ test_expect_success 'format-patch --base with --attach' '\n test_expect_success 'format-patch --attach cover-letter only is non-multipart' '\n \ttest_when_finished \"rm -fr patches\" &&\n \tgit format-patch -o patches --cover-letter --attach=mimemime --base=HEAD~ -1 &&\n-\t! egrep \"^--+mimemime\" patches/0000*.patch &&\n-\tegrep \"^--+mimemime$\" patches/0001*.patch >output &&\n+\t! grep -E \"^--+mimemime\" patches/0000*.patch &&\n+\tgrep -E \"^--+mimemime$\" patches/0001*.patch >output &&\n \ttest_line_count = 2 output &&\n-\tegrep \"^--+mimemime--$\" patches/0001*.patch >output &&\n+\tgrep -E \"^--+mimemime--$\" patches/0001*.patch >output &&\n \ttest_line_count = 1 output\n '\n \ndiff --git a/t/t5320-delta-islands.sh b/t/t5320-delta-islands.sh\nindex fea92a5777..8016571cbf 100755\n--- a/t/t5320-delta-islands.sh\n+++ b/t/t5320-delta-islands.sh\n@@ -132,7 +132,7 @@ test_expect_success 'island core places core objects first' '\n \t    repack -adfi &&\n \tgit verify-pack -v .git/objects/pack/*.pack |\n \tcut -d\" \" -f1 |\n-\tegrep \"$root|$two\" >actual &&\n+\tgrep -E \"$root|$two\" >actual &&\n \ttest_cmp expect actual\n '\n \ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex e18a218952..a00cdba049 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -49,7 +49,7 @@ test_expect_success 'result is really identical' '\n test_expect_success 'rewrite bare repository identically' '\n \t(git config core.bare true && cd .git &&\n \t git filter-branch branch > filter-output 2>&1 &&\n-\t! fgrep fatal filter-output)\n+\t! grep -F fatal filter-output)\n '\n git config core.bare false\n test_expect_success 'result is really identical' '\n@@ -506,7 +506,7 @@ test_expect_success 'rewrite repository including refs that point at non-commit\n \tgit tag -a -m \"tag to a tree\" treetag $new_tree &&\n \tgit reset --hard HEAD &&\n \tgit filter-branch -f -- --all >filter-output 2>&1 &&\n-\t! fgrep fatal filter-output\n+\t! grep -F fatal filter-output\n '\n \n test_expect_success 'filter-branch handles ref deletion' '\ndiff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh\nindex 937f89ee8c..b7ac4f598a 100755\n--- a/t/t7701-repack-unpack-unreachable.sh\n+++ b/t/t7701-repack-unpack-unreachable.sh\n@@ -35,7 +35,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '\n \tgit repack -A -d -l &&\n \t# verify objects are packed in repository\n \ttest 3 = $(git verify-pack -v -- .git/objects/pack/*.idx |\n-\t\t   egrep \"^($fsha1|$csha1|$tsha1) \" |\n+\t\t   grep -E \"^($fsha1|$csha1|$tsha1) \" |\n \t\t   sort | uniq | wc -l) &&\n \tgit show $fsha1 &&\n \tgit show $csha1 &&\n@@ -49,7 +49,7 @@ test_expect_success '-A with -d option leaves unreachable objects unpacked' '\n \tgit repack -A -d -l &&\n \t# verify objects are retained unpacked\n \ttest 0 = $(git verify-pack -v -- .git/objects/pack/*.idx |\n-\t\t   egrep \"^($fsha1|$csha1|$tsha1) \" |\n+\t\t   grep -E \"^($fsha1|$csha1|$tsha1) \" |\n \t\t   sort | uniq | wc -l) &&\n \tgit show $fsha1 &&\n \tgit show $csha1 &&\ndiff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh\nindex aa0c20499b..c8df9f39c0 100755\n--- a/t/t9001-send-email.sh\n+++ b/t/t9001-send-email.sh\n@@ -1518,7 +1518,7 @@ test_expect_success $PREREQ 'asks about and fixes 8bit encodings' '\n \tgrep \"do not declare a Content-Transfer-Encoding\" stdout &&\n \tgrep email-using-8bit stdout &&\n \tgrep \"Which 8bit encoding\" stdout &&\n-\tegrep \"Content|MIME\" msgtxt1 >actual &&\n+\tgrep -E \"Content|MIME\" msgtxt1 >actual &&\n \ttest_cmp content-type-decl actual\n '\n \n@@ -1529,7 +1529,7 @@ test_expect_success $PREREQ 'sendemail.8bitEncoding works' '\n \tgit send-email --from=author@example.com --to=nobody@example.com \\\n \t\t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t\temail-using-8bit >stdout &&\n-\tegrep \"Content|MIME\" msgtxt1 >actual &&\n+\tgrep -E \"Content|MIME\" msgtxt1 >actual &&\n \ttest_cmp content-type-decl actual\n '\n \n@@ -1544,7 +1544,7 @@ test_expect_success $PREREQ 'sendemail.8bitEncoding in .git/config overrides --g\n \tgit send-email --from=author@example.com --to=nobody@example.com \\\n \t\t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t\temail-using-8bit >stdout &&\n-\tegrep \"Content|MIME\" msgtxt1 >actual &&\n+\tgrep -E \"Content|MIME\" msgtxt1 >actual &&\n \ttest_cmp content-type-decl actual\n '\n \n@@ -1556,7 +1556,7 @@ test_expect_success $PREREQ '--8bit-encoding overrides sendemail.8bitEncoding' '\n \t\t\t--smtp-server=\"$(pwd)/fake.sendmail\" \\\n \t\t\t--8bit-encoding=UTF-8 \\\n \t\t\temail-using-8bit >stdout &&\n-\tegrep \"Content|MIME\" msgtxt1 >actual &&\n+\tgrep -E \"Content|MIME\" msgtxt1 >actual &&\n \ttest_cmp content-type-decl actual\n '\n \ndiff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh\nindex f894860867..d8d536269c 100755\n--- a/t/t9133-git-svn-nested-git-repo.sh\n+++ b/t/t9133-git-svn-nested-git-repo.sh\n@@ -35,7 +35,7 @@ test_expect_success 'SVN-side change outside of .git' '\n \t\techo b >> a &&\n \t\tsvn_cmd commit -m \"SVN-side change outside of .git\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change outside of .git\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change outside of .git\"\n \t)\n '\n \n@@ -59,7 +59,7 @@ test_expect_success 'SVN-side change inside of .git' '\n \t\tsvn_cmd add --force .git &&\n \t\tsvn_cmd commit -m \"SVN-side change inside of .git\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change inside of .git\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change inside of .git\"\n \t)\n '\n \n@@ -82,7 +82,7 @@ test_expect_success 'SVN-side change in and out of .git' '\n \t\tgit commit -m \"add a inside an SVN repo\" &&\n \t\tsvn_cmd commit -m \"SVN-side change in and out of .git\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change in and out of .git\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change in and out of .git\"\n \t)\n '\n \ndiff --git a/t/t9134-git-svn-ignore-paths.sh b/t/t9134-git-svn-ignore-paths.sh\nindex fff49c4100..fec244d2aa 100755\n--- a/t/t9134-git-svn-ignore-paths.sh\n+++ b/t/t9134-git-svn-ignore-paths.sh\n@@ -43,7 +43,7 @@ test_expect_success 'init+fetch an SVN repository with ignored www directory' '\n test_expect_success 'verify ignore-paths config saved by clone' '\n \t(\n \t    cd g &&\n-\t    git config --get svn-remote.svn.ignore-paths | fgrep \"www\"\n+\t    git config --get svn-remote.svn.ignore-paths | grep -F \"www\"\n \t)\n '\n \n@@ -53,7 +53,7 @@ test_expect_success 'SVN-side change outside of www' '\n \t\techo b >> qqq/test_qqq.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change outside of www\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change outside of www\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change outside of www\"\n \t)\n '\n \n@@ -85,7 +85,7 @@ test_expect_success 'SVN-side change inside of ignored www' '\n \t\techo zaq >> www/test_www.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change inside of www/test_www.txt\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change inside of www/test_www.txt\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change inside of www/test_www.txt\"\n \t)\n '\n \n@@ -118,7 +118,7 @@ test_expect_success 'SVN-side change in and out of ignored www' '\n \t\techo ygg >> qqq/test_qqq.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change in and out of ignored www\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change in and out of ignored www\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change in and out of ignored www\"\n \t)\n '\n \ndiff --git a/t/t9140-git-svn-reset.sh b/t/t9140-git-svn-reset.sh\nindex e855904629..b3c9425d55 100755\n--- a/t/t9140-git-svn-reset.sh\n+++ b/t/t9140-git-svn-reset.sh\n@@ -43,7 +43,7 @@ test_expect_success 'fetch fails on modified hidden file' '\n \t  git svn find-rev refs/remotes/git-svn > ../expect &&\n \t  test_must_fail git svn fetch 2> ../errors &&\n \t  git svn find-rev refs/remotes/git-svn > ../expect2 ) &&\n-\tfgrep \"not found in commit\" errors &&\n+\tgrep -F \"not found in commit\" errors &&\n \ttest_cmp expect expect2\n '\n \n@@ -59,7 +59,7 @@ test_expect_success 'refetch succeeds not ignoring any files' '\n \t( cd g &&\n \t  git svn fetch &&\n \t  git svn rebase &&\n-\t  fgrep \"mod hidden\" hid/hid.txt\n+\t  grep -F \"mod hidden\" hid/hid.txt\n \t)\n '\n \ndiff --git a/t/t9147-git-svn-include-paths.sh b/t/t9147-git-svn-include-paths.sh\nindex d292bf9f55..6cd2e4a2c7 100755\n--- a/t/t9147-git-svn-include-paths.sh\n+++ b/t/t9147-git-svn-include-paths.sh\n@@ -45,7 +45,7 @@ test_expect_success 'init+fetch an SVN repository with included qqq directory' '\n test_expect_success 'verify include-paths config saved by clone' '\n \t(\n \t    cd g &&\n-\t    git config --get svn-remote.svn.include-paths | fgrep \"qqq\"\n+\t    git config --get svn-remote.svn.include-paths | grep -F \"qqq\"\n \t)\n '\n \n@@ -55,7 +55,7 @@ test_expect_success 'SVN-side change outside of www' '\n \t\techo b >> qqq/test_qqq.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change outside of www\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change outside of www\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change outside of www\"\n \t)\n '\n \n@@ -87,7 +87,7 @@ test_expect_success 'SVN-side change inside of ignored www' '\n \t\techo zaq >> www/test_www.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change inside of www/test_www.txt\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change inside of www/test_www.txt\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change inside of www/test_www.txt\"\n \t)\n '\n \n@@ -120,7 +120,7 @@ test_expect_success 'SVN-side change in and out of included qqq' '\n \t\techo ygg >> qqq/test_qqq.txt &&\n \t\tsvn_cmd commit -m \"SVN-side change in and out of ignored www\" &&\n \t\tsvn_cmd up &&\n-\t\tsvn_cmd log -v | fgrep \"SVN-side change in and out of ignored www\"\n+\t\tsvn_cmd log -v | grep -F \"SVN-side change in and out of ignored www\"\n \t)\n '\n \ndiff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh\nindex 468767cbf4..e856be111a 100755\n--- a/t/t9814-git-p4-rename.sh\n+++ b/t/t9814-git-p4-rename.sh\n@@ -216,7 +216,7 @@ test_expect_success 'detect copies' '\n # variable exists, which allows admins to disable the \"p4 move\" command.\n test_lazy_prereq P4D_HAVE_CONFIGURABLE_RUN_MOVE_ALLOW '\n \tp4 configure show run.move.allow >out &&\n-\tegrep ^run.move.allow: out\n+\tgrep ^run.move.allow: out\n '\n \n # If move can be disabled, turn it off and test p4 move handling\ndiff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh\nindex 9779dc0d11..ce75d4debe 100755\n--- a/t/t9815-git-p4-submit-fail.sh\n+++ b/t/t9815-git-p4-submit-fail.sh\n@@ -417,8 +417,8 @@ test_expect_success 'cleanup chmod after submit cancel' '\n \t\t! p4 fstat -T action text &&\n \t\ttest_path_is_file text+x &&\n \t\t! p4 fstat -T action text+x &&\n-\t\tls -l text | egrep ^-r-- &&\n-\t\tls -l text+x | egrep ^-r-x\n+\t\tls -l text | grep ^-r-- &&\n+\t\tls -l text+x | grep ^-r-x\n \t)\n '\n \ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex eef2262a36..b316a32dff 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -867,7 +867,7 @@ test_path_exists () {\n test_dir_is_empty () {\n \ttest \"$#\" -ne 1 && BUG \"1 param\"\n \ttest_path_is_dir \"$1\" &&\n-\tif test -n \"$(ls -a1 \"$1\" | egrep -v '^\\.\\.?$')\"\n+\tif test -n \"$(ls -a1 \"$1\" | grep -Ev '^\\.\\.?$')\"\n \tthen\n \t\techo \"Directory '$1' is not empty, it contains:\"\n \t\tls -la \"$1\"\n-- \n2.25.1\n\n"},{"id":"441037","messageId":"211113.8635o1ug4g.gmgdl@evledraar.gmail.com","threadId":"56883","inReplyTo":"20211112225334.1862016-1-ville.skytta@iki.fi","subject":"Re: [PATCH] Makefile, git-sh-setup.sh, t/: do not use `egrep` or `fgrep`","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-11-12T23:02:41Z","receivedAt":"2021-11-12T23:08:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sat, Nov 13 2021, Ville Skyttä wrote:\n\n> `egrep` and `fgrep` have been deprecated in GNU grep since 2007, and in\n> current post 3.7 Git they have been made to emit obsolescence warnings.\n>\n> `grep -E` and `grep -F` on the other hand have been in POSIX and its\n> predecessors for decades; use them instead, and use basic regular\n> expressions instead of extended ones where applicable.\n>\n> Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>\n> ---\n>  Makefile                             | 2 +-\n>  git-sh-setup.sh                      | 2 +-\n>  t/perf/run                           | 4 ++--\n>  t/t1304-default-acl.sh               | 4 ++--\n>  t/t3700-add.sh                       | 2 +-\n>  t/t3702-add-edit.sh                  | 2 +-\n>  t/t4014-format-patch.sh              | 8 ++++----\n>  t/t5320-delta-islands.sh             | 2 +-\n>  t/t7003-filter-branch.sh             | 4 ++--\n>  t/t7701-repack-unpack-unreachable.sh | 4 ++--\n>  t/t9001-send-email.sh                | 8 ++++----\n>  t/t9133-git-svn-nested-git-repo.sh   | 6 +++---\n>  t/t9134-git-svn-ignore-paths.sh      | 8 ++++----\n>  t/t9140-git-svn-reset.sh             | 4 ++--\n>  t/t9147-git-svn-include-paths.sh     | 8 ++++----\n>  t/t9814-git-p4-rename.sh             | 2 +-\n>  t/t9815-git-p4-submit-fail.sh        | 4 ++--\n>  t/test-lib-functions.sh              | 2 +-\n>  18 files changed, 38 insertions(+), 38 deletions(-)\n\nSounds sensible, but as far as sane_egrep goes this branch would be\nbetter built on top of my ab/sh-retire-helper-functions, i.e. the\nsane_egrep you're changing here will be gone entirely once that merges\ndown (post-upcoming release, presumably).\n\nOn the other hand that conflict is rather minor.\n\n> [...]\n>  # If move can be disabled, turn it off and test p4 move handling\n> diff --git a/t/t9815-git-p4-submit-fail.sh b/t/t9815-git-p4-submit-fail.sh\n> index 9779dc0d11..ce75d4debe 100755\n> --- a/t/t9815-git-p4-submit-fail.sh\n> +++ b/t/t9815-git-p4-submit-fail.sh\n> @@ -417,8 +417,8 @@ test_expect_success 'cleanup chmod after submit cancel' '\n>  \t\t! p4 fstat -T action text &&\n>  \t\ttest_path_is_file text+x &&\n>  \t\t! p4 fstat -T action text+x &&\n> -\t\tls -l text | egrep ^-r-- &&\n> -\t\tls -l text+x | egrep ^-r-x\n> +\t\tls -l text | grep ^-r-- &&\n> +\t\tls -l text+x | grep ^-r-x\n>  \t)\n>  '\n>  \n> diff \n\nThis looks completely fine since this use is trivial, i.e. let's just\nuse BRE here.\n\nBut just a note that on some implementations BRE & ERE aren't just a\nsyntax difference, but they dispatch to entirely different regex\nengines. I've seen very different performance characteristics with BRE\nv.s. ERE, and even cases on some GNU software (can't recall the\nspecifics now, sorry, I think on glibc) where some things that are\npathological and have runaway memory use on BRE would be just fine on\nERE.\n\nSo again, it doesn't matter here, but just since you're poking in this\narea a note that -E isn't just \"I'm using ERE features\". I think it's\nprobably a good idea to always use it, unles there's a good reason not\nto.\n"}]}