git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "SZEDER Gábor" <szeder.dev@gmail.com>
To: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/4] t: remove \{m,n\} from BRE grep usage
Date: Tue, 20 Sep 2022 18:43:17 +0200	[thread overview]
Message-ID: <20220920164317.GA1704@szeder.dev> (raw)
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:
> \{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.


  reply	other threads:[~2022-09-20 16:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 15:49 [PATCH 0/4] allow grep -E, and remove egrep Đoàn Trần Công Danh
2022-09-20 15:49 ` [PATCH 1/4] CodingGuidelines: allow grep -E Đoàn Trần Công Danh
2022-09-20 15:49 ` [PATCH 2/4] t: remove \{m,n\} from BRE grep usage Đoàn Trần Công Danh
2022-09-20 16:43   ` SZEDER Gábor [this message]
2022-09-20 17:42   ` Phillip Wood
2022-09-20 17:52   ` Junio C Hamano
2022-09-20 15:49 ` [PATCH 3/4] t: convert egrep usage to "grep -E" Đoàn Trần Công Danh
2022-09-20 15:49 ` [PATCH 4/4] t: convert fgrep usage to "grep -F" Đoàn Trần Công Danh
2022-09-20 17:52 ` [PATCH 0/4] allow grep -E, and remove egrep Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220920164317.GA1704@szeder.dev \
    --to=szeder.dev@gmail.com \
    --cc=congdanhqx@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).