@matheusbsbs / matheus-bagliano / commits / 009c98ee17
Fork 0

CodingGuidelines: spell out how we use grep in our scripts

Our scripts try to stick to fairly limited subset of POSIX BRE for portability. It is unclear from manual page from GNU grep which is GNU extension and which is portable, so let's spell it out to help new people to keep their contributions from hurting porters. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Mar 1, 2008 at 18:18 UTC 009c98ee170b36598548cc67c54826544cced108
1 file changed +12
Documentation/CodingGuidelines
+12
@@ -53,6 +53,18 @@ For shell scripts specifically (not exhaustive):
53 - We do not write the noiseword "function" in front of shell
54 functions.
55
56 + - As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
57 + [::], [==], nor [..]) for portability.
58 +
59 + - We do not use \{m,n\};
60 +
61 + - We do not use -E;
62 +
63 + - We do not use ? nor + (which are \{0,1\} and \{1,\}
64 + respectively in BRE) but that goes without saying as these
65 + are ERE elements not BRE (note that \? and \+ are not even part
66 + of BRE -- making them accessible from BRE is a GNU extension).
67 +
68 For C programs:
69
70 - We use tabs to indent, and interpret tabs as taking up to