{"thread":{"id":"47452","subject":"[PATCH] p7519: improve check for prerequisite WATCHMAN","startedAt":"2017-12-16T12:12:38Z","lastAt":"2017-12-18T16:05:24Z","messageCount":2,"participants":["René Scharfe","Ben Peart"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"334926","messageId":"fb8f1b3b-3668-db21-993c-087aee279936@web.de","threadId":"47452","inReplyTo":null,"subject":"[PATCH] p7519: improve check for prerequisite WATCHMAN","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2017-12-16T12:12:23Z","receivedAt":"2017-12-16T12:12:38Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"The return code of command -v with a non-existing command is 1 in bash\nand 127 in dash.  Use that return code directly to allow the script to\nwork with dash and without watchman (e.g. on Debian).\n\nWhile at it stop redirecting the output.  stderr is redirected to\n/dev/null by test_lazy_prereq already, and stdout can actually be \nuseful -- the path of the found watchman executable is sent there, but\nit's shown only if the script was run with --verbose.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n t/perf/p7519-fsmonitor.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh\nindex 16d1bf72e5..65e145c02d 100755\n--- a/t/perf/p7519-fsmonitor.sh\n+++ b/t/perf/p7519-fsmonitor.sh\n@@ -40,8 +40,7 @@ test_lazy_prereq UNTRACKED_CACHE '\n '\n \n test_lazy_prereq WATCHMAN '\n-\t{ command -v watchman >/dev/null 2>&1; ret=$?; } &&\n-\ttest $ret -ne 1\n+\tcommand -v watchman\n '\n \n if test_have_prereq WATCHMAN\n-- \n2.15.1\n"},{"id":"334969","messageId":"MWHPR21MB04782C421CE40E6FA468AFF4F40E0@MWHPR21MB0478.namprd21.prod.outlook.com","threadId":"47452","inReplyTo":"fb8f1b3b-3668-db21-993c-087aee279936@web.de","subject":"RE: [PATCH] p7519: improve check for prerequisite WATCHMAN","fromName":"Ben Peart","fromEmail":"ben.peart@microsoft.com","sentAt":"2017-12-18T16:05:11Z","receivedAt":"2017-12-18T16:05:24Z","isPatch":true,"sender":{"key":"benpeart@microsoft.com","avatar":"https://avatars.githubusercontent.com/u/15252029?v=4"},"body":"> -----Original Message-----\n> From: René Scharfe [mailto:l.s.r@web.de]\n> Sent: Saturday, December 16, 2017 7:12 AM\n> To: Git List <git@vger.kernel.org>\n> Cc: Junio C Hamano <gitster@pobox.com>; Ben Peart\n> <Ben.Peart@microsoft.com>; Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com>\n> Subject: [PATCH] p7519: improve check for prerequisite WATCHMAN\n> \n> The return code of command -v with a non-existing command is 1 in bash\n> and 127 in dash.  Use that return code directly to allow the script to work\n> with dash and without watchman (e.g. on Debian).\n> \n> While at it stop redirecting the output.  stderr is redirected to /dev/null by\n> test_lazy_prereq already, and stdout can actually be useful -- the path of the\n> found watchman executable is sent there, but it's shown only if the script\n> was run with --verbose.\n> \n> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n> ---\n>  t/perf/p7519-fsmonitor.sh | 3 +--\n>  1 file changed, 1 insertion(+), 2 deletions(-)\n> \n> diff --git a/t/perf/p7519-fsmonitor.sh b/t/perf/p7519-fsmonitor.sh index\n> 16d1bf72e5..65e145c02d 100755\n> --- a/t/perf/p7519-fsmonitor.sh\n> +++ b/t/perf/p7519-fsmonitor.sh\n> @@ -40,8 +40,7 @@ test_lazy_prereq UNTRACKED_CACHE '\n>  '\n> \n>  test_lazy_prereq WATCHMAN '\n> -\t{ command -v watchman >/dev/null 2>&1; ret=$?; } &&\n> -\ttest $ret -ne 1\n> +\tcommand -v watchman\n>  '\n\nLooks good to me.  I tested this on Windows and it still works with and without watchman.  Thanks for the update to get this working on other platforms.\n\n> \n>  if test_have_prereq WATCHMAN\n> --\n> 2.15.1\n"}]}