aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-01 18:18:16 -0800
committerJunio C Hamano <gitster@pobox.com>2008-03-01 18:18:16 -0800
commit009c98ee170b36598548cc67c54826544cced108 (patch)
treeeb5e81b7aefef1861594417fb72a8333cfdfd0ea
parentc14918415a36e93a84ed1f58ce079619f84e26fa (diff)
downloadgit-009c98ee170b36598548cc67c54826544cced108.tar.gz
git-009c98ee170b36598548cc67c54826544cced108.tar.xz
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>
-rw-r--r--Documentation/CodingGuidelines12
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 3b042db62..994eb9159 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -53,6 +53,18 @@ For shell scripts specifically (not exhaustive):
- We do not write the noiseword "function" in front of shell
functions.
+ - As to use of grep, stick to a subset of BRE (namely, no \{m,n\},
+ [::], [==], nor [..]) for portability.
+
+ - We do not use \{m,n\};
+
+ - We do not use -E;
+
+ - We do not use ? nor + (which are \{0,1\} and \{1,\}
+ respectively in BRE) but that goes without saying as these
+ are ERE elements not BRE (note that \? and \+ are not even part
+ of BRE -- making them accessible from BRE is a GNU extension).
+
For C programs:
- We use tabs to indent, and interpret tabs as taking up to