Skip to content

Commit 2b52163

Browse files
sunshinecogitster
authored andcommitted
check-non-portable-shell: detect obsolescent egrep/fgrep
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. [1]: https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html Signed-off-by: Eric Sunshine <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 75fc96d commit 2b52163

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

t/check-non-portable-shell.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ sub err {
4545
/\bhead\s+-c\b/ and err 'head -c is not portable (use test_copy_bytes BYTES <file >out)';
4646
/(?:\$\(seq|^\s*seq\b)/ and err 'seq is not portable (use test_seq)';
4747
/\bgrep\b.*--file\b/ and err 'grep --file FILE is not portable (use grep -f FILE)';
48+
/\b[ef]grep\b/ and err 'egrep/fgrep obsolescent (use grep -E/-F)';
4849
/\bexport\s+[A-Za-z0-9_]*=/ and err '"export FOO=bar" is not portable (use FOO=bar && export FOO)';
4950
/^\s*([A-Z0-9_]+=(\w*|(["']).*?\3)\s+)+(\w+)/ and exists($func{$4}) and
5051
err '"FOO=bar shell_func" assignment extends beyond "shell_func"';

0 commit comments

Comments
 (0)