Skip to content

Commit

Permalink
CodingGuidelines: spell out how we use grep in our scripts
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Mar 2, 2008
1 parent c149184 commit 009c98e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Documentation/CodingGuidelines
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 009c98e

Please sign in to comment.