Thread (1 message) 1 message, 1 author, 2022-09-21

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

From: Junio C Hamano <hidden>
Date: 2022-09-21 18:07:07

Đoàn Trần Công Danh  [off-list ref] 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:
GIT_TEST_DEFAULT_HASH=sha256
Absolutely.  This alone is a change worth doing regardless of the
portability issues.
Signed-off-by: Đoàn Trần Công Danh <redacted>
---

 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.
OK.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help