mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH] check-non-portable-shell: detect obsolescent egrep/fgrep
@ 2022-09-22  0:18 Eric Sunshine via GitGitGadget
  0 siblings, 0 replies; only message in thread
From: Eric Sunshine via GitGitGadget @ 2022-09-22  0:18 UTC (permalink / raw)
  To: git; +Cc: Đoàn Trần Công Danh, Eric Sunshine,
	Eric Sunshine

From: Eric Sunshine <>

GNU grep deprecated `egrep` and `fgrep` with release 2.5.3 in 2007.
As of release 3.8 in 2022, those commands warn[1] that they are
obsolescent. Now that all the Git test scripts have been scrubbed of
uses of `egrep` and `fgrep`, make `check-non-portable-shell` complain
about them to prevent new instances from creeping back into the project.


Signed-off-by: Eric Sunshine <>
    check-non-portable-shell: detect obsolescent egrep/fgrep
    This is atop 'dd/retire-efgrep'.

Fetch-It-Via: git fetch pr-git-1338/sunshineco/efgrep-v1

 t/ | 1 +
 1 file changed, 1 insertion(+)

diff --git a/t/ b/t/
index fd3303552be..dd8107cd7da 100755
--- a/t/
+++ b/t/
@@ -45,6 +45,7 @@ while (<>) {
 	/\bhead\s+-c\b/ and err 'head -c is not portable (use test_copy_bytes BYTES <file >out)';
 	/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
 	/\bgrep\b.*--file\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';
+	/\b[ef]grep\b/ and err 'egrep/fgrep obsolescent (use grep -E/-F)';
 	/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
 	/^\s*([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
 		err '"FOO=bar shell_func" assignment extends beyond "shell_func"';

base-commit: 1b3d6e17fe83eb6f79ffbac2f2c61bbf1eaef5f8

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-22  0:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22  0:18 [PATCH] check-non-portable-shell: detect obsolescent egrep/fgrep Eric Sunshine via GitGitGadget

Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).