author | Tim Henigan <tim.henigan@gmail.com> | |
Fri, 24 Feb 2012 23:12:58 +0000 (18:12 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 27 Feb 2012 23:10:23 +0000 (15:10 -0800) | ||
commit | 860f70f9f4206379361fd5af84c8fde31984b418 | |
tree | 74806c7f14b85fa2e1075722b49e3c7e75377a1e | tree | snapshot |
parent | 48f359bfafa7db4c399fa13f17ccfea7c35f333b | commit | diff |
CodingGuidelines: do not use 'which' in shell scripts
During the code review of a recent patch, it was noted that shell scripts
must not use 'which $cmd' to check the availability of the command $cmd.
The output of the command is not machine parseable and its exit code is
not reliable across platforms.
It is better to use 'type' to accomplish this task.
Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
During the code review of a recent patch, it was noted that shell scripts
must not use 'which $cmd' to check the availability of the command $cmd.
The output of the command is not machine parseable and its exit code is
not reliable across platforms.
It is better to use 'type' to accomplish this task.
Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/CodingGuidelines | diff | blob | history |