git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] t: allow use of "sed -E"

From
Ramsay Jones <ramsay@ramsayjones.plus.com>
Date
Mar 11, 2026, 23:12 UTC
Message-ID
<77fce76d-07e2-4586-bb6c-f0043d171591@ramsayjones.plus.com>
In-Reply-To
<xmqq1phqm4ca.fsf@gitster.g>
On 11/03/2026 9:41 pm, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
> 
[snip]
Show 29 quoted lines
>>
>> Let's change the rule to allow the "-E" option, which nobody has
>> complained against for the past 3 years.  We rewrite our first use
>> of the "-E" option so that it is caught by the old rule, primarily
>> because we do not want to teach our mischievous developers how to
>> smuggle in an unwated option undetected by the test lint.  And at
> 
> "unwated" -> "unwanted", of course ;-)
> 
>> the same time, loosen the pattern to allow "-E" the same way we
>> allow "-n" and friends.
>>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>>
>>  t/check-non-portable-shell.pl | 2 +-
>>  t/t6030-bisect-porcelain.sh   | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git c/t/check-non-portable-shell.pl w/t/check-non-portable-shell.pl
>> index 6ee7700eb4..dd8af6d08f 100755
>> --- c/t/check-non-portable-shell.pl
>> +++ w/t/check-non-portable-shell.pl
>> @@ -36,7 +36,7 @@ sub err {
>>  
>>  	$_ = $line;
>>  	/\bcp\s+-a/ and err 'cp -a is not portable';
>> -	/\bsed\s+-[^efn]\s+/ and err 'sed option not portable (use only -n, -e, -f)';
>> +	/\bsed\s+-[^Eefn]\s+/ and err 'sed option not portable (use only -n, -e, -f)';
.. and, perhaps, add -E to the error message?

ATB, Ramsay Jones

Show 17 quoted lines
>>  	/\becho\s+-[neE]/ and err 'echo with option is not portable (use printf)';
>>  	/^\s*declare\s+/ and err 'arrays/declare not portable';
>>  	/^\s*[^#]\s*which\s/ and err 'which is not portable (use type)';
>> diff --git c/t/t6030-bisect-porcelain.sh w/t/t6030-bisect-porcelain.sh
>> index cdc0270640..1ba9ca219e 100755
>> --- c/t/t6030-bisect-porcelain.sh
>> +++ w/t/t6030-bisect-porcelain.sh
>> @@ -402,7 +402,7 @@ test_expect_success 'git bisect run: negative exit code' "
>>  	git bisect good $HASH1 &&
>>  	git bisect bad $HASH4 &&
>>  	! git bisect run ./fail.sh 2>err &&
>> -	sed -En 's/.*(bisect.*code) (-?[0-9]+) (from.*)/\1 -1 \3/p' err >actual &&
>> +	sed -E -n 's/.*(bisect.*code) (-?[0-9]+) (from.*)/\1 -1 \3/p' err >actual &&
>>  	test_cmp expect actual
>>  "
>>  
> 
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “[RFC] t: allow use of "sed -E"”
  1. Junio C HamanoMar 11, 2026
  2. Junio C HamanoMar 11, 2026
  3. Ramsay JonesMar 11, 2026
  4. Junio C HamanoMar 12, 2026
  5. t: allow use of "sed -E"Junio C Hamano, Mar 12, 2026
  6. Patrick SteinhardtMar 12, 2026
  7. brian m. carlsonMar 12, 2026
  8. Junio C HamanoMar 12, 2026
  9. Todd ZullingerMar 14, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.