{"thread":{"id":"58483","subject":"[PATCH] check-non-portable-shell: detect obsolescent egrep/fgrep","startedAt":"2022-09-22T00:18:36Z","lastAt":"2022-09-22T00:18:36Z","messageCount":1,"participants":["Eric Sunshine via GitGitGadget"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"463411","messageId":"pull.1338.git.git.1663805905554.gitgitgadget@gmail.com","threadId":"58483","inReplyTo":null,"subject":"[PATCH] check-non-portable-shell: detect obsolescent egrep/fgrep","fromName":"Eric Sunshine via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-09-22T00:18:25Z","receivedAt":"2022-09-22T00:18:36Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"From: Eric Sunshine <sunshine@sunshineco.com>\n\nGNU grep deprecated `egrep` and `fgrep` with release 2.5.3 in 2007.\nAs of release 3.8 in 2022, those commands warn[1] that they are\nobsolescent. Now that all the Git test scripts have been scrubbed of\nuses of `egrep` and `fgrep`, make `check-non-portable-shell` complain\nabout them to prevent new instances from creeping back into the project.\n\n[1]: https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html\n\nSigned-off-by: Eric Sunshine <sunshine@sunshineco.com>\n---\n    check-non-portable-shell: detect obsolescent egrep/fgrep\n    \n    This is atop 'dd/retire-efgrep'.\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1338%2Fsunshineco%2Fefgrep-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1338/sunshineco/efgrep-v1\nPull-Request: https://github.com/git/git/pull/1338\n\n t/check-non-portable-shell.pl | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/check-non-portable-shell.pl b/t/check-non-portable-shell.pl\nindex fd3303552be..dd8107cd7da 100755\n--- a/t/check-non-portable-shell.pl\n+++ b/t/check-non-portable-shell.pl\n@@ -45,6 +45,7 @@ while (<>) {\n \t/\\bhead\\s+-c\\b/ and err 'head -c is not portable (use test_copy_bytes BYTES <file >out)';\n \t/(?:\\$\\(seq|^\\s*seq\\b)/ and err 'seq is not portable (use test_seq)';\n \t/\\bgrep\\b.*--file\\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';\n+\t/\\b[ef]grep\\b/ and err 'egrep/fgrep obsolescent (use grep -E/-F)';\n \t/\\bexport\\s+[A-Za-z0-9_]*=/ and err '\"export FOO=bar\" is not portable (use FOO=bar && export FOO)';\n \t/^\\s*([A-Z0-9_]+=(\\w*|([\"']).*?\\3)\\s+)+(\\w+)/ and exists($func{$4}) and\n \t\terr '\"FOO=bar shell_func\" assignment extends beyond \"shell_func\"';\n\nbase-commit: 1b3d6e17fe83eb6f79ffbac2f2c61bbf1eaef5f8\n-- \ngitgitgadget\n"}]}