From patchwork Mon Nov 21 17:58:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Sixt X-Patchwork-Id: 13051512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BB47C433FE for ; Mon, 21 Nov 2022 17:58:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbiKUR6T (ORCPT ); Mon, 21 Nov 2022 12:58:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiKUR6Q (ORCPT ); Mon, 21 Nov 2022 12:58:16 -0500 Received: from bsmtp.bon.at (bsmtp.bon.at [213.33.87.14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B5A5DFEF for ; Mon, 21 Nov 2022 09:58:15 -0800 (PST) Received: from [192.168.0.98] (unknown [93.83.142.38]) by bsmtp.bon.at (Postfix) with ESMTPSA id 4NGFVY3d80z5tlG; Mon, 21 Nov 2022 18:58:13 +0100 (CET) Message-ID: Date: Mon, 21 Nov 2022 18:58:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US To: Philippe Blain Cc: =?utf-8?q?Ren=C3=A9_Scharfe?= , Git Mailing List From: Johannes Sixt Subject: [PATCH] t3920: don't ignore errors of more than one command with `|| true` Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It is customary to write `A || true` to ignore a potential error exit of command A. But when we have a sequence `A && B && C || true && D`, then a failure of any of A, B, or C skips to D right away. This is not intended here. Turn the command whose failure is to be ignored into a compound command to ensure it is the only one that is allowed to fail. Signed-off-by: Johannes Sixt --- t/t3920-crlf-messages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index 4c661d4d54..a58522c163 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -12,7 +12,7 @@ create_crlf_ref () { cat >.crlf-orig-$branch.txt && cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt && grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt && - grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true && + { grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true; } && LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" && test_tick && hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) && From patchwork Fri Dec 2 16:51:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13062957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2054AC4321E for ; Fri, 2 Dec 2022 16:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233612AbiLBQvY (ORCPT ); Fri, 2 Dec 2022 11:51:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46880 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbiLBQvW (ORCPT ); Fri, 2 Dec 2022 11:51:22 -0500 Received: from mout.web.de (mout.web.de [212.227.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF66ACA4A for ; Fri, 2 Dec 2022 08:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1669999874; bh=U0O7dWje4GtmRtvHsPX21rENkUorUyVxer6HFjJ4veU=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ttLT/mtU/YTERc1fMBPcW2yZ6h4h8DEQBhtGH5CdazkDQXhywtvqMEsVRStMFElWB 4mqLIqzsizte8wMWTuDcKc7VUBb542AGm0PNFlYINeCT8bUe8BTpMPpJhRxQhAVpOw W3uu9avr2G+owXjKbyq/cyzU7xp5OHNVYnBXgmdB5Xn+1DWVC51L3bYUe53IBK4kxN cnsN2wdI8Q4LBPL12zPJNGJUrFc4rrWipqiJguA6lxcK6uT3TggQmZnECOy563LKk2 +Xo0GMiTtgTxfnvp9H8EocScNsJhE2tVgNgtCtdRHspekUWJYOlTRklTQRHywN80UX tyL/bDzbypuAg== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.35] ([91.47.154.159]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MWi9q-1pTn2I2560-00XFUN; Fri, 02 Dec 2022 17:51:14 +0100 Message-ID: Date: Fri, 2 Dec 2022 17:51:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: [PATCH 2/1] t3920: support CR-eating grep To: Johannes Sixt , Philippe Blain Cc: Git Mailing List , Junio C Hamano References: From: =?utf-8?q?Ren=C3=A9_Scharfe?= In-Reply-To: X-Provags-ID: V03:K1:1EKaGuOf0WnI9a/DgojWKpm+TEs1OKswOPPioDNVs1Pllq2771/ 1Rn25cFwxMYZDpnQbJZlZ0HnytuLbTQrpSOO09YjnmuzHit6I3Ysq1hD84+JsigCTFJu3ay WN9MfCCGRmz5UqK3IKKT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uF8tZmW5P2yxPt6zgfAAb AuNC4McXMMQte5f0nV4Eqo/qydA= Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org grep(1) converts CRLF line endings to CR on current MinGW: $ uname -sr MINGW64_NT-10.0-22621 3.3.6-341.x86_64 $ printf 'a\r\n' | hexdump.exe -C 00000000 61 0d 0a |a..| 00000003 $ printf 'a\r\n' | grep . | hexdump.exe -C 00000000 61 0a |a.| 00000002 Create the intended test file by grepping the original file with LF line endings and adding CRs explicitly. The missing CRs went unnoticed because test_cmp on MinGW ignores line endings since 4d715ac05c (Windows: a test_cmp that is agnostic to random LF <> CRLF conversions, 2013-10-26). Fix this test anyway to avoid depending on that special test_cmp behavior, especially since this is the only test that needs it. Piping the output of grep(1) through append_cr has the side-effect of ignoring its return value. That means we no longer need the explicit "|| true" to support commit messages without a body. Signed-off-by: René Scharfe Acked-by: Philippe Blain --- t/t3920-crlf-messages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.38.1.windows.1 diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index a58522c163..67fd2345af 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -12,7 +12,7 @@ create_crlf_ref () { cat >.crlf-orig-$branch.txt && cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt && grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt && - { grep 'Body' .crlf-message-$branch.txt >.crlf-body-$branch.txt || true; } && + grep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt && LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" && test_tick && hash=$(git commit-tree HEAD^{tree} -p HEAD -F .crlf-message-${branch}.txt) && From patchwork Fri Dec 2 16:51:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13062958 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD66EC4321E for ; Fri, 2 Dec 2022 16:51:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234084AbiLBQva (ORCPT ); Fri, 2 Dec 2022 11:51:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbiLBQvZ (ORCPT ); Fri, 2 Dec 2022 11:51:25 -0500 Received: from mout.web.de (mout.web.de [212.227.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656C0B7DDD for ; Fri, 2 Dec 2022 08:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1669999878; bh=ww/RvJA9ufj3hJ8KxBA/E4889hMCTXWViv6Hel5ve8A=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=TVuGH7iWtt0y3EHjc89r76zH/VxN0vRR1fzs3XlrbvrLFvEZeCeLl1jAGesLV64P4 nZzZgfX4+yLjBeSPGmnJ8kAFQEjWPEf7wW3PLGND6fElaDOsUckdf7Luzo78pumXMD fXSqQRceGvAD9Sc06spUjlj+v3jSd4yQ8vw1SCN207NSPpa9oHsZGyIK/sDcfAkBuV WG0ddcMiMS0fYkVcyrw+/70LhRwkN797U40vn87uXS1kcFk2I4lC/kY243CskZ5BsN S1I5/IF4uEqua3QP3qipmU7IA4YPkyUjnr4jH3JmSjo+CK3sTyo7mAXv8KkN/PbNWt 1w2mUpmNTkAtQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.35] ([91.47.154.159]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MZSFY-1pWXvE2gzO-00WhAZ; Fri, 02 Dec 2022 17:51:18 +0100 Message-ID: <9dd8764d-bda9-6602-9ce5-af14de32e315@web.de> Date: Fri, 2 Dec 2022 17:51:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: [PATCH 3/1] t3920: simplify redirection of loop output To: Johannes Sixt , Philippe Blain Cc: Git Mailing List , junio C Hamano References: From: =?utf-8?q?Ren=C3=A9_Scharfe?= In-Reply-To: X-Provags-ID: V03:K1:DPILryLXAfzwPnwTjcJWUZ2hWo3AZ4QqcICxWVBP61qi7ODVuGu P2aF3T5AcMLuMVXufIA/lHQN09EPxMEZ/6iLMcou6aciHdQ5QrUtQIlRJ77AKXincV/7NKO 6RUt30bOdlagliq+DLpRm69q2h0YtCN07PmLo7oHmjc4gQ+tg+xTX5ZvRd+kQ10CsogACt9 2zcif1fgQ6xxzmhqytrPg== UI-OutboundReport: notjunk:1;M01:P0:XiXDix/ULoo=;ZkvRkyZxcieLh9A1nv8u1B/cLrb cz7LKy8upaxrJpqfEAmKRQ5Aq9r9kuhNt/b6ND3q8pzOypSEfXpOrvdcry5YWtjXBzvljQMYW BCWUgYzAwk2JYxMuHRBLnB+wEJ3Li6zE4JxD3ZkOSpv10HRX4tUM16pEwVScM9iB6Rr5ko8Im /IowJHuMf1eC4v0YrH/tBTDG1XuwETSLS7474bCmVUzjrRMwyIHT0zzMiMhWK12mwf8Dp1ZED yH2os+wDlrM6M8/qLiActyF1PNlOudOjBFVkzysV1yWiWF/ZmO7JwTWHoZodU+nFuGrLtUy1O pfGxtkuzeleY+K2HTTQqG1odUOWr+9w6Raiyz1ENz7RmHYnULVRVBxv9lkY+wrzIgCdyc/qMY NL+J9CBE4iy/NE8ASgwx6U/IbSbqcjdYOCvlC6Oxf00/N7mvUQR7JCcyHHXEGuN5z9ZEhNzD5 MYTTr0HZLXY9jNzZ+UUATsntuAQpuUqUb4O+WqSs0M3ePcb8+lrc+6IBbo44JR7D8iYkL2iQg cxMETGGsPNr+xfRaM0tjH4Q3VtlvnsTFpAx0WWYfWSCfFkt75IK9DnqovwTh5a4unTfawqfBL aldcDS/gC2IYG9pRrsrbzxGRSRuwYTzWa+p1ZzRJs6Kilmypqd5iNfo3gFRiatNKHX3PaY7ta I8vf+MCp7+Ze1Z+08BT/DtQsXtOSEVdFRwFn5M1ET73CKvpAq+VyHawXu0uPGp7ZNI7/TSVn8 CTlm+BelSdV9IyJmk2Ku95KSyzok1bOO5PnT0lPQ8SdpkWgAKg32XjqBnvbJDAZd2TRwz57T4 c4C6ngVyVuw9wnRAigHbD+JzojBxRzDrJea4eGM9yBZa6KcJYEZogsQC4k6QF6UvglUcFkaiT 864eT0nyRxVyd/umkXgG8Byzg8NE6EC4q0cLHlwPqt4KHEVgM+f4vDP1P91Preeduam4+mUPB QN4Zlg== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Redirect the output of for loops once instead of deleting the receiving file and appending the output of individual commands. This reduces repetition and speeds up the test. Here are the numbers on my Windows machine before: $ (cd t && hyperfine.exe -w3 "sh.exe t3920-crlf-messages.sh") Benchmark 1: sh.exe t3920-crlf-messages.sh Time (mean ± σ): 5.923 s ± 0.037 s [User: 0.000 s, System: 0.004 s] Range (min … max): 5.889 s … 5.997 s 10 runs ... and with this patch: Benchmark 1: sh.exe t3920-crlf-messages.sh Time (mean ± σ): 5.705 s ± 0.047 s [User: 0.000 s, System: 0.001 s] Range (min … max): 5.632 s … 5.772 s 10 runs Signed-off-by: René Scharfe --- t/t3920-crlf-messages.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.38.1.windows.1 diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index 67fd2345af..4fc9fa9cad 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -68,12 +68,11 @@ test_crlf_subject_body_and_contents() { set ${atoms} && atom=$1 && shift && atoms="$*" && set ${files} && file=$1 && shift && files="$*" && test_expect_success "${command}: --format='%${atom}' works with messages using CRLF" " - rm -f expect && for ref in ${LIB_CRLF_BRANCHES} do - cat .crlf-${file}-\"\${ref}\".txt >>expect && - printf \"\n\" >>expect || return 1 - done && + cat .crlf-${file}-\"\${ref}\".txt && + printf \"\n\" || return 1 + done >expect && git $command_and_args --format=\"%${atom}\" >actual && test_cmp expect actual " @@ -87,13 +86,12 @@ test_expect_success 'Setup refs with commit and tag messages using CRLF' ' ' test_expect_success 'branch: --verbose works with messages using CRLF' ' - rm -f expect && for branch in $LIB_CRLF_BRANCHES do - printf " " >>expect && - cat .crlf-subject-${branch}.txt >>expect && - printf "\n" >>expect || return 1 - done && + printf " " && + cat .crlf-subject-${branch}.txt && + printf "\n" t || return 1 + done >expect && git branch -v >tmp && # Remove first two columns, and the line for the currently checked out branch current=$(git branch --show-current) && From patchwork Fri Dec 2 16:51:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ren=C3=A9_Scharfe?= X-Patchwork-Id: 13062959 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65C9CC4321E for ; Fri, 2 Dec 2022 16:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234014AbiLBQvc (ORCPT ); Fri, 2 Dec 2022 11:51:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233682AbiLBQva (ORCPT ); Fri, 2 Dec 2022 11:51:30 -0500 Received: from mout.web.de (mout.web.de [217.72.192.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 360EBB7DDD for ; Fri, 2 Dec 2022 08:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1669999882; bh=Bl3rFSRc9kDl3IBcQriX7bkS+PIUqhZXyaKNd0j4BTk=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=vCZnpUkHeNrI1Rb9m9TfPhg1jOb6eav916b/WHJCIpiflOy+JjR3MWI1mLBSDlqYh Dx7yOpoO/kbafog58UA+AVnpCGIwQbXqsSF2AyO4YZg0fLbm40x22SEiHMk9UN9t2o XVFaMVtfV+Qmkc8HEQu3z8qQd6Pl8sjdApJzocArqX/6lK+p/KM/FRbrhl4NEgym+O 669TyhBtCirOVU9dFjPNOMNd7NvTRIPj9srcnA0N2PpH29sTq4l6n2beg47mS/4dUq HxL0Xb1Y4IJdsAD8qJEEakondjjT65IRkFMhijIzQPgXV37w9vgmQfqoWcmGg0migE UDYg7HVfd5hLQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.35] ([91.47.154.159]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MiMAO-1oX3N630qM-00fXaH; Fri, 02 Dec 2022 17:51:22 +0100 Message-ID: <203cb627-2423-8a35-d280-9f9ffc66e072@web.de> Date: Fri, 2 Dec 2022 17:51:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: [PATCH 4/1] t3920: replace two cats with a tee To: Johannes Sixt , Philippe Blain Cc: Git Mailing List , junio C Hamano References: From: =?utf-8?q?Ren=C3=A9_Scharfe?= In-Reply-To: X-Provags-ID: V03:K1:wbXYqIyPjB4v3Y6iS84CRy2mDnbeDy1PJS3oGTX6MPer4b1ecYE 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DO3jwxc+vw1LeNQSVrdOrzfqJL3VCrnWVy njn7TV+HBumuKNHi48x5BN3ldrRY4C6jIPStOVMqhfFZMgJ6HA88hq/ggcUXnTgB/v69JwaT3 fXm0Pw== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Use tee(1) to replace two calls of cat(1) for writing files with different line endings. That's shorter and spawns less processes. It has a small, but measurable performance impact on my Windows machine. Here are the numbers before: $ (cd t && hyperfine.exe -w3 "sh.exe t3920-crlf-messages.sh") Benchmark 1: sh.exe t3920-crlf-messages.sh Time (mean ± σ): 5.705 s ± 0.047 s [User: 0.000 s, System: 0.001 s] Range (min … max): 5.632 s … 5.772 s 10 runs ... and with this patch: $ (cd t && hyperfine.exe -w3 "sh.exe t3920-crlf-messages.sh") Benchmark 1: sh.exe t3920-crlf-messages.sh Time (mean ± σ): 5.616 s ± 0.021 s [User: 0.001 s, System: 0.002 s] Range (min … max): 5.577 s … 5.644 s 10 runs Signed-off-by: René Scharfe --- t/t3920-crlf-messages.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.38.1.windows.1 diff --git a/t/t3920-crlf-messages.sh b/t/t3920-crlf-messages.sh index 4fc9fa9cad..1f64ce565f 100755 --- a/t/t3920-crlf-messages.sh +++ b/t/t3920-crlf-messages.sh @@ -9,8 +9,7 @@ LIB_CRLF_BRANCHES="" create_crlf_ref () { branch="$1" && - cat >.crlf-orig-$branch.txt && - cat .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt && + tee .crlf-orig-$branch.txt | append_cr >.crlf-message-$branch.txt && grep 'Subject' .crlf-orig-$branch.txt | tr '\n' ' ' | sed 's/[ ]*$//' | tr -d '\n' >.crlf-subject-$branch.txt && grep 'Body' .crlf-orig-$branch.txt | append_cr >.crlf-body-$branch.txt && LIB_CRLF_BRANCHES="${LIB_CRLF_BRANCHES} ${branch}" &&