mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <>
To: "Đoàn Trần Công Danh" <>
Cc:, "SZEDER Gábor" <>,
	"Phillip Wood" <>
Subject: Re: [PATCH v2 2/4] t: remove \{m,n\} from BRE grep usage
Date: Wed, 21 Sep 2022 11:06:56 -0700	[thread overview]
Message-ID: <xmqqpmfo38lb.fsf@gitster.g> (raw)
In-Reply-To: <> ("Đoàn Trần Công Danh"'s message of "Wed, 21 Sep 2022 20:02:30 +0700")

Đoàn Trần Công Danh  <> writes:

> The CodingGuidelines says we should avoid \{m,n\} in BRE usage.
> And their usages in our code base is limited, and subjectively
> hard to read.
> Replace them with ERE.

OK.  I do not personally mind allowing \{0,1\} in BRE (which would
give us a portable way to express '?'), but we are not forbidding
ERE in any way, so I am OK with the direction.

> Except for "0\{40\}" which would be changed to "$ZERO_OID",
> which is a better value for testing with:

Absolutely.  This alone is a change worth doing regardless of the
portability issues.

> Signed-off-by: Đoàn Trần Công Danh <>
> ---
>  Phillip Wood said:
>  > \{m,n\} is valid in a posix BRE[1]. If we're already using it without
>  > anyone
>  > complaining I think it would be better to update CodingGuidlines to allow
>  > it.
>  Yes, I agree. However, I think our usage of \{m,n\} is limited.
>  Let's skip the lifting for now.


  reply	other threads:[~2022-09-21 18:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21 13:02 [PATCH v2 0/4] allow "grep -E", remove {e,f}grep usage Đoàn Trần Công Danh
2022-09-21 13:02 ` [PATCH v2 1/4] CodingGuidelines: allow grep -E Đoàn Trần Công Danh
2022-09-21 13:02 ` [PATCH v2 2/4] t: remove \{m,n\} from BRE grep usage Đoàn Trần Công Danh
2022-09-21 18:06   ` Junio C Hamano [this message]
2022-09-21 13:02 ` [PATCH v2 3/4] t: convert egrep usage to "grep -E" Đoàn Trần Công Danh
2022-09-21 13:02 ` [PATCH v2 4/4] t: convert fgrep usage to "grep -F" Đoàn Trần Công Danh

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:

  List information:

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

  git send-email \
    --in-reply-to=xmqqpmfo38lb.fsf@gitster.g \ \ \ \ \ \

* 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

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