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

Re: [PATCH 2/4] t: remove \{m,n\} from BRE grep usage

From
SZEDER Gábor <szeder.dev@gmail.com>
Date
Sep 20, 2022, 16:43 UTC
Message-ID
<20220920164317.GA1704@szeder.dev>
In-Reply-To
<752b12ef1e27d3b69d6aa3734309895082be7886.1663688697.git.congdanhqx@gmail.com>
On Tue, Sep 20, 2022 at 10:49:14PM +0700, Đoàn Trần Công Danh wrote:
Show 28 quoted lines
> \{m,n\} is a GNU extension to BRE, and it's forbidden by our
> CodingGuidelines.
> 
> Change to fixed strings or ERE.
> 
> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
> ---
>  t/t3200-branch.sh             | 6 ++++--
>  t/t3305-notes-fanout.sh       | 2 +-
>  t/t3404-rebase-interactive.sh | 6 +++---
>  t/t5550-http-fetch-dumb.sh    | 2 +-
>  t/t5702-protocol-v2.sh        | 2 +-
>  5 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
> index 9723c2827c..f05ac1fe0b 100755
> --- a/t/t3200-branch.sh
> +++ b/t/t3200-branch.sh
> @@ -201,8 +201,10 @@ test_expect_success 'git branch -M baz bam should succeed when baz is checked ou
>  
>  test_expect_success 'git branch -M baz bam should add entries to .git/logs/HEAD' '
>  	msg="Branch: renamed refs/heads/baz to refs/heads/bam" &&
> -	grep " 0\{40\}.*$msg$" .git/logs/HEAD &&
> -	grep "^0\{40\}.*$msg$" .git/logs/HEAD
> +	zero="00000000" &&
> +	zero="$zero$zero$zero$zero$zero" &&
> +	grep " $zero.*$msg$" .git/logs/HEAD &&
> +	grep "^$zero.*$msg$" .git/logs/HEAD
I think these could use $ZERO_OID instead.
Previous: Đoàn Trần Công DanhNext: Phillip Wood
Message 4 of 9 in “allow grep -E, and remove egrep”
  1. 0/4 allow grep -E, and remove egrepĐoàn Trần Công Danh, Sep 20, 2022
  2. 1/4 CodingGuidelines: allow grep -EĐoàn Trần Công Danh, Sep 20, 2022
  3. 2/4 t: remove \{m,n\} from BRE grep usageĐoàn Trần Công Danh, Sep 20, 2022
  4. SZEDER GáborSep 20, 2022
  5. Phillip WoodSep 20, 2022
  6. Junio C HamanoSep 20, 2022
  7. 3/4 t: convert egrep usage to "grep -E"Đoàn Trần Công Danh, Sep 20, 2022
  8. 4/4 t: convert fgrep usage to "grep -F"Đoàn Trần Công Danh, Sep 20, 2022
  9. Junio C HamanoSep 20, 2022

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.