git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tim Henigan <tim.henigan@gmail.com>
To: git@vger.kernel.org, gitster@pobox.com
Cc: tim.henigan@gmail.com
Subject: [PATCH 2/2] CodingGuidelines: Add note forbidding use of 'which' in shell scripts
Date: Fri, 24 Feb 2012 16:12:01 -0500	[thread overview]
Message-ID: <1330117921-8257-2-git-send-email-tim.henigan@gmail.com> (raw)
In-Reply-To: <1330117921-8257-1-git-send-email-tim.henigan@gmail.com>

During the code review of a recent patch, it was noted that shell scripts
must not use 'which'.  The output of the command is not machine parseable
and its exit code is not reliable across platforms.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
---
 Documentation/CodingGuidelines |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index a4ffe7c..3505a4b 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -44,6 +44,10 @@ For shell scripts specifically (not exhaustive):
    properly nests.  It should have been the way Bourne spelled
    it from day one, but unfortunately isn't.
 
+ - The use of 'which' is not allowed.  The output of 'which' is not
+   machine parseable and its exit code is not reliable across
+   platforms.
+
  - We use POSIX compliant parameter substitutions and avoid bashisms;
    namely:
 
-- 
1.7.9.1

  reply	other threads:[~2012-02-27 17:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24 21:12 [PATCH 1/2] CodingGuidelines: Add a note about spaces after redirection Tim Henigan
2012-02-24 21:12 ` Tim Henigan [this message]
2012-02-27 18:56   ` [PATCH 2/2] CodingGuidelines: Add note forbidding use of 'which' in shell scripts Junio C Hamano
2012-02-27 18:55 ` [PATCH 1/2] CodingGuidelines: Add a note about spaces after redirection Junio C Hamano

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1330117921-8257-2-git-send-email-tim.henigan@gmail.com \
    --to=tim.henigan@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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.
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 NNTP newsgroup(s).