From patchwork Thu Jul 21 06:51:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12924792 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 11C95C433EF for ; Thu, 21 Jul 2022 06:51:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231934AbiGUGvx (ORCPT ); Thu, 21 Jul 2022 02:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231911AbiGUGvw (ORCPT ); Thu, 21 Jul 2022 02:51:52 -0400 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B8B42ADC for ; Wed, 20 Jul 2022 23:51:51 -0700 (PDT) Received: by mail-wm1-x32c.google.com with SMTP id r1-20020a05600c35c100b003a326685e7cso2755186wmq.1 for ; Wed, 20 Jul 2022 23:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xwNUnKeoNQm5DMYSMRaMHH0JVn64qjEyjTvR/aBNjg4=; b=cOEmI0J2742Eaq8Fsq8dHWFiMJ1KkecdpzBPWhawYTfHCDRQJ8mv2G7Fji6l+yE678 w7El8ejhX7X5HIYkaJQCu4w1+0hDZ5FfUJsg+rdfx+fuzQZrlLkUxTfhdoUtcKgVKWnS gSVk5lxtb2BktJ58Wx6dsTROzuHojGrexilnViWHBm5dGR89qEm5/CrTlcpdTBAqvOZV 8OidE1O2gfXK2u4JCVUEE7kbRTGNxFXuAIAN8DNDJWDWmWwieF+G62dI9zL6zq4Zw6EP ut9RYOL0YjA3HMVAgjcGDmS7s8GkhCJXgxDgLDUGwyIdf6FQ8bDN0JfWwaMbopuEfQw3 /XgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xwNUnKeoNQm5DMYSMRaMHH0JVn64qjEyjTvR/aBNjg4=; b=Dfk7ZSonn/91QlPfrvgM3iUI0G4RY0SMlDrlvWUFGZQjVtbXwVgfBozGgFoqdBBRCS J2XKmiJYMupFJewsDZ94aWSB6TwePFsw23NlrpFqhk9eqtzZ3KvZ+RyIp9EtmEzDJIoA 7BiHDPTnC0PV4KXGYJq/J4li9ijtFK7W4vIMhAFHQ6Zd4leFP7b45nSMDeAeirJRXtM0 7cW5SkWuPhkadtcte+5dNIyfbz3OFem71XsMrxrN6noHnZxZP6scd3Utk1wS3+9g6ufa 53nml9GEpWBPQqIZQOUQ0ZBy3rFCnkPSM3Gt6Gt6f4D6NKoPLpZupBR0ky4yX8imh9br LOvw== X-Gm-Message-State: AJIora8Tw2OdEsewMG+hXkQsLtjaYkTorLeeOki8BOHTcZeJHZx/XyZC oR3XZTW3d7+84PIRaxH/E6iijlEDzsADwA== X-Google-Smtp-Source: AGRyM1vy/6jdKansqiG6kvZu4R7rqZLd1pQqy4zQnRA5SBSCCDwAqtAKhjg5K5l4R5bQdNdjqP9lQg== X-Received: by 2002:a1c:a382:0:b0:3a3:2644:664f with SMTP id m124-20020a1ca382000000b003a32644664fmr7009390wme.41.1658386309370; Wed, 20 Jul 2022 23:51:49 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n124-20020a1c2782000000b003a2c67aa6c0sm1006746wmn.23.2022.07.20.23.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:51:48 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 1/6] diff tests: fix ignored exit codes in t4023 Date: Thu, 21 Jul 2022 08:51:38 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1095.g64a1e8362fd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change a "git diff-tree" command to be &&-chained so that we won't ignore its exit code, see the ea05fd5fbf7 (Merge branch 'ab/keep-git-exit-codes-in-tests', 2022-03-16) topic for prior art. This fixes code added in b45563a229f (rename: Break filepairs with different types., 2007-11-30). Due to hiding the exit code we hid a memory leak under SANITIZE=leak. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t4023-diff-rename-typechange.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t4023-diff-rename-typechange.sh b/t/t4023-diff-rename-typechange.sh index 7cb99092938..25c31b0cb1b 100755 --- a/t/t4023-diff-rename-typechange.sh +++ b/t/t4023-diff-rename-typechange.sh @@ -52,8 +52,8 @@ test_expect_success setup ' ' test_expect_success 'cross renames to be detected for regular files' ' - - git diff-tree five six -r --name-status -B -M | sort >actual && + git diff-tree five six -r --name-status -B -M >out && + sort actual && { echo "R100 foo bar" && echo "R100 bar foo" @@ -63,8 +63,8 @@ test_expect_success 'cross renames to be detected for regular files' ' ' test_expect_success 'cross renames to be detected for typechange' ' - - git diff-tree one two -r --name-status -B -M | sort >actual && + git diff-tree one two -r --name-status -B -M >out && + sort actual && { echo "R100 foo bar" && echo "R100 bar foo" @@ -74,8 +74,8 @@ test_expect_success 'cross renames to be detected for typechange' ' ' test_expect_success 'moves and renames' ' - - git diff-tree three four -r --name-status -B -M | sort >actual && + git diff-tree three four -r --name-status -B -M >out && + sort actual && { # see -B -M (#6) in t4008 echo "C100 foo bar" && From patchwork Thu Jul 21 06:51:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12924793 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 21571C43334 for ; Thu, 21 Jul 2022 06:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231977AbiGUGv4 (ORCPT ); Thu, 21 Jul 2022 02:51:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiGUGvx (ORCPT ); Thu, 21 Jul 2022 02:51:53 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D28342ADA for ; Wed, 20 Jul 2022 23:51:52 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id v5so502580wmj.0 for ; Wed, 20 Jul 2022 23:51:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YlD+1cF2W6YAC1TF8qxd2/lm+nSauRSxGyMf5TpkcvI=; b=QFKHLKvWiRcVTJ82CyPyOaJ65Y8hYQeVkWdznrrHK/EiP1P3DhUbRhnWrqfvOlpsdC E7TcZjJNO8Czlj7p+nUYO8wymqVzy7OdiE+S0woEHSaRhYyevqmZldJkQqBBT5px8j+i I/XBO+T/kK2R6lkIt2Gq7td+EvjpG4hxlwulDLbm2n0vO/TF5UcL69+sP6wUgn/xdnLB pAhW/ZCRHIolMMO43of8Qrw8oIkPmt7fNI6vhZ+UNw0ECjS1G9cfBGmZEaZEugbZosva o54sIPHOj06FFQ4Dq3bTVVc7gyvqBO7iNgvB7t0Wci9rWJgh0BJQ+6EQHGjFrN6qEbVW XTZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YlD+1cF2W6YAC1TF8qxd2/lm+nSauRSxGyMf5TpkcvI=; b=EiQaafxAperhdR2xFbx3lbGVb+IQ8VWivj6IyUnPHM/S4HFpGb6rlBeej54s6sm9Kh wf8dOZyLncEsxsbpuPX/GvA0l0G6RtEOb5mdmAMSyCSioIMuX7wapWCpzofUo3fjth5W epyE8ka11RoMg/UljXKD9YLMJRjTDstK2NsMRtAY/LDzlAy2uZQZ6ViYbSiqkCSVcxFU l6L+ZMiB//HaUASXUKDDlOk13KUAIgK+aKmHLd3w/PLCBZlX/pfCC6GMC4aToy8eiR0T XezVJAW0a76HTIUHho6dB7KtgYj5UVxWYNG+aEF7FvdLYAOlh9QQ5oBlyqK+jaGE4y1I Tucg== X-Gm-Message-State: AJIora/8qApZBr+GuT9VxoBbs+gnJN9hgJinvcDC/zMe0w2QZNGQ0oVH 86PgWVMNj58bcHISqQgNzUNJYE4BvTd4aw== X-Google-Smtp-Source: AGRyM1sCFBIeUyTbNj6m4LXZB9zr2iEz4uxDXpw/5kkfhA0OUEKQGVNvmj4JwTeHv2vIV2zl+eXKXw== X-Received: by 2002:a05:600c:4eca:b0:3a1:9a2a:e373 with SMTP id g10-20020a05600c4eca00b003a19a2ae373mr7093980wmq.153.1658386310453; Wed, 20 Jul 2022 23:51:50 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n124-20020a1c2782000000b003a2c67aa6c0sm1006746wmn.23.2022.07.20.23.51.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:51:49 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 2/6] t/lib-patch-mode.sh: fix ignored "git" exit codes Date: Thu, 21 Jul 2022 08:51:39 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1095.g64a1e8362fd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Fix code added in b319ef70a94 (Add a small patch-mode testing library, 2009-08-13) to use &&-chaining and test_cmp instead of interpolating "git" commands in a "test" statement. This fixes cases where we'd have e.g. missed memory leaks under SANITIZE=leak, this code doesn't leak now as far as I can tell, but I discovered it while looking at leaks in related code. The "cat _head >expect" here is redundant, we could simply give "_head" to "test_cmp", but let's be consistent in using the "expect" and "actual" names for clarity. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/lib-patch-mode.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/t/lib-patch-mode.sh b/t/lib-patch-mode.sh index cfd76bf987b..887554933c2 100644 --- a/t/lib-patch-mode.sh +++ b/t/lib-patch-mode.sh @@ -29,8 +29,13 @@ set_and_save_state () { # verify_state verify_state () { - test "$(cat "$1")" = "$2" && - test "$(git show :"$1")" = "$3" + echo "$2" >expect && + cat "$1" >actual && + test_cmp expect actual && + + echo "$3" >expect + git show :"$1" >actual && + test_cmp expect actual } # verify_saved_state @@ -46,5 +51,7 @@ save_head () { } verify_saved_head () { - test "$(cat _head)" = "$(git rev-parse HEAD)" + cat _head >expect && + git rev-parse HEAD >actual && + test_cmp expect actual } From patchwork Thu Jul 21 06:51:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12924794 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 D9A6FC433EF for ; Thu, 21 Jul 2022 06:51:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232035AbiGUGv6 (ORCPT ); Thu, 21 Jul 2022 02:51:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbiGUGv4 (ORCPT ); Thu, 21 Jul 2022 02:51:56 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEDA143E76 for ; Wed, 20 Jul 2022 23:51:53 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id a5so832265wrx.12 for ; Wed, 20 Jul 2022 23:51:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CHPlOvB9BolXygdxbu2hs/4D26c34RrvRAp87yASSEI=; b=CynMtHrODB5ZySz2rMNNJQB7MyqGmrNqz4zUPspD1aWUW/ZpkPv5Z368ljSXsxuehR SXMPHAKJQ1kjbarHR6DwhvevXhXfKq7FQ6lhjTdVkYgIbD8R6CWXVRS/aHiUOyPKXowN fttJfFbiDH2du64Jl5tEPN/55pjIY0A8xeRyTEx5wrhAwDbWKtuox0ZLRtFZ4/V1xyo2 /83bTAOhtzi61MtBSNBz098mbWUNpBS7E8eyHCkDU+B3pO1pcEWAPn3KqqNktqTBFaXN UHZm9YvR9ippxsjgXCZal0IiMNTqTxZZqLfLnL8ANOWzWZYN5UHfym5XJqavyScVGd/3 guSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CHPlOvB9BolXygdxbu2hs/4D26c34RrvRAp87yASSEI=; b=X8Kq/w5hkrrqxaD67peeBy3GNMkCqw+2O4mx3x4WQDgz1WZTKKGG1aqyTkwPDuu+xo qa/5FF/U25RRfUxwTxoXLB9qZ5ibvvvFMtEHGaMzsoA97ZVD+N8+A+viT1vsS/T5qwGu ZpK2RrcNxNHWhBtiMFud1DNem06y8jSc/pqlFxtuhFcwhscufzCsvWLDW9WNwmFn/XVo MrlqwtJxFsQn+k93bs6CcL+WgCdoBt+JOjCdznHLmVerh6dm+hOh1K+aF65W8sLy7KoN NrDmY4lAyUnPu94ECVMiVvcWNg3AQGBSOkLa0rPJ2cgRmVTkLxZlKi1jO7h6hGXF2THb EZjg== X-Gm-Message-State: AJIora9zw1WB1EesKIZ2qQARywd5KEpGN0Vc42aD+FWMBxSnE+90TLts ttkQ6qhc4G4XvJMfqDazADoV2To13cufPg== X-Google-Smtp-Source: AGRyM1uxoCFF2RWwYKRZU1PxeGLVQjeyqEOKg+rqlxt9yEAyIH8sUyrncPAgYJJmaWDNKmzH0nj71A== X-Received: by 2002:adf:e310:0:b0:21e:3e46:81f8 with SMTP id b16-20020adfe310000000b0021e3e4681f8mr8123784wrj.188.1658386311859; Wed, 20 Jul 2022 23:51:51 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n124-20020a1c2782000000b003a2c67aa6c0sm1006746wmn.23.2022.07.20.23.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:51:50 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 3/6] auto-crlf tests: check "git checkout" exit code Date: Thu, 21 Jul 2022 08:51:40 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1095.g64a1e8362fd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Don't hide the exit code from the "git checkout" we run to checkout our attributes file. This fixes cases where we'd have e.g. missed memory leaks under SANITIZE=leak, this code doesn't leak (the relevant "git checkout" leak has been fixed), but in a past version of git we'd continue past this failure under SANITIZE=leak when these invocations had errored out, even under "--immediate". Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t0027-auto-crlf.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh index 7f80f463930..03b955b774f 100755 --- a/t/t0027-auto-crlf.sh +++ b/t/t0027-auto-crlf.sh @@ -293,11 +293,17 @@ checkout_files () { pfx=eol_${ceol}_crlf_${crlf}_attr_${attr}_ && for f in LF CRLF LF_mix_CR CRLF_mix_LF LF_nul do - rm crlf_false_attr__$f.txt && - if test -z "$ceol"; then - git checkout -- crlf_false_attr__$f.txt + if test -z "$ceol" + then + test_expect_success "setup $f checkout" ' + rm crlf_false_attr__$f.txt && + git checkout -- crlf_false_attr__$f.txt + ' else - git -c core.eol=$ceol checkout -- crlf_false_attr__$f.txt + test_expect_success "setup $f checkout with core.eol=$ceol" ' + rm crlf_false_attr__$f.txt && + git -c core.eol=$ceol checkout -- crlf_false_attr__$f.txt + ' fi done From patchwork Thu Jul 21 06:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12924795 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 38384C433EF for ; Thu, 21 Jul 2022 06:52:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232056AbiGUGwA (ORCPT ); Thu, 21 Jul 2022 02:52:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbiGUGv4 (ORCPT ); Thu, 21 Jul 2022 02:51:56 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10925D0EE for ; Wed, 20 Jul 2022 23:51:54 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id id17so486831wmb.1 for ; Wed, 20 Jul 2022 23:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tF6rQyvJEX57WPMb1eq90AmSq24y/rXeoSPnyKy8LBs=; b=BMsdEg9E/XkBXPuapvrC1SZ0dOZyb08fLzNiMe1lh5R7FEHVeYo8N42ZaGk/Rqxm58 Pl0KgIJgh7c6WL54pv+IPDeOVJNML383vC6Nt74f2vLGte2MRwgcO/XpjR5D9z7yn/oL RGCdT87MPjoQ8EkZslbpszR1V6/zT7+erAXEto8kEo20Lw8xZIdc/h7+QoCKeEodxozQ 7Pu8p7UVvaXTYB3T/4PcoJPWDT+h23g1ilcBKi0ELn6AxjiCjV35Yhou0bFe5yrt93/8 uFJgvrV9dtsWRX/JrtJ6XJhgo5k6trO6PYZNseVUJcJD//Q81Fmb2yL2TQ7FW3IgCGd6 +TMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tF6rQyvJEX57WPMb1eq90AmSq24y/rXeoSPnyKy8LBs=; b=3R4sh/6ch3TRtgjjoiTQFiNwxyC86uJ95oyv/RO91kBcYI3jEQOt4shGcoL96iWo6T 9YQUW7cDMcsK3rSLbNcPg+CpWHEinJ6fuX0ibnGngvTBJ6qa2lta94sPPVBPdOiAzXSt w/lDhTRecSQttTbYeV83kdDbREXRZeqyjH/LBJ300HcW5Tl22kUIIK9fgahynFu5/3k+ zm5gvrIxoK20esbvh1y92XoFQ16UayB6gE2S0K8KsZ/Yv6wnlnTPcUzaXhmIAh8L8tR9 fFcPxm5Y8DDZE54l4NdB04+qQHiB6NN/5dxt7TbmeIIlGcAnL3DVJj60yDCx7/PQVsTP XjVQ== X-Gm-Message-State: AJIora9xYRXIC44Wgl4TQ/aRSLrUvczizLot1h+ebIeYs5b0AEP5M9D/ twS7CPcRa0owrbmXgm2AcgE/blCC4XcWlA== X-Google-Smtp-Source: AGRyM1vaR3eIqAa1bJploWv3xRs0ty2Af2bnHNu5fU/FEc94a7AVHimxaS4Dwzj+EMNluUdBgwDISg== X-Received: by 2002:a05:600c:1d21:b0:3a3:3227:e482 with SMTP id l33-20020a05600c1d2100b003a33227e482mr634521wms.121.1658386312903; Wed, 20 Jul 2022 23:51:52 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n124-20020a1c2782000000b003a2c67aa6c0sm1006746wmn.23.2022.07.20.23.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:51:52 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 4/6] test-lib-functions: add and use test_cmp_cmd Date: Thu, 21 Jul 2022 08:51:41 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1095.g64a1e8362fd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add a "test_cmp_cmd" helper for the common pattern discussed in the documentation being added here to "t/test-lib-functions.sh". This implementation leaves the door open for extending this helper past its obvious limitations, such as: test_cmp_cmd "some" "lines" -- test_cmp_cmd --stdin By using this in t0060-path.sh we'll catch cases where "git" or "test-tool" errors (such as segfaults or abort()) were previously hidden, and we'd either pass the test, or fail in some subsequent assertion. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t0060-path-utils.sh | 45 +++++++++++++++++++++++------------------ t/test-lib-functions.sh | 18 +++++++++++++++++ 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh index 1f2007e62b7..6f278417e83 100755 --- a/t/t0060-path-utils.sh +++ b/t/t0060-path-utils.sh @@ -10,8 +10,11 @@ TEST_PASSES_SANITIZE_LEAK=true norm_path() { expected=$(test-tool path-utils print_path "$2") - test_expect_success $3 "normalize path: $1 => $2" \ - "test \"\$(test-tool path-utils normalize_path_copy '$1')\" = '$expected'" + test_expect_success $3 "normalize path: $1 => $2" " + echo '$expected' >expect && + test-tool path-utils normalize_path_copy '$1' >actual && + test_cmp expect actual + " } relative_path() { @@ -166,8 +169,10 @@ ancestor D:/Users/me C:/ -1 MINGW ancestor //server/share/my-directory //server/share/ 14 MINGW test_expect_success 'strip_path_suffix' ' - test c:/msysgit = $(test-tool path-utils strip_path_suffix \ - c:/msysgit/libexec//git-core libexec/git-core) + echo c:/msysgit >expect && + test-tool path-utils strip_path_suffix \ + c:/msysgit/libexec//git-core libexec/git-core >actual && + test_cmp expect actual ' test_expect_success 'absolute path rejects the empty string' ' @@ -189,34 +194,34 @@ test_expect_success 'real path rejects the empty string' ' test_expect_success POSIX 'real path works on absolute paths 1' ' nopath="hopefully-absent-path" && - test "/" = "$(test-tool path-utils real_path "/")" && - test "/$nopath" = "$(test-tool path-utils real_path "/$nopath")" + test_cmp_cmd / test-tool path-utils real_path "/" && + test_cmp_cmd "/$nopath" test-tool path-utils real_path "/$nopath" ' test_expect_success 'real path works on absolute paths 2' ' nopath="hopefully-absent-path" && # Find an existing top-level directory for the remaining tests: d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") && - test "$d" = "$(test-tool path-utils real_path "$d")" && - test "$d/$nopath" = "$(test-tool path-utils real_path "$d/$nopath")" + test_cmp_cmd "$d" test-tool path-utils real_path "$d" && + test_cmp_cmd "$d/$nopath" test-tool path-utils real_path "$d/$nopath" ' test_expect_success POSIX 'real path removes extra leading slashes' ' nopath="hopefully-absent-path" && - test "/" = "$(test-tool path-utils real_path "///")" && - test "/$nopath" = "$(test-tool path-utils real_path "///$nopath")" && + test_cmp_cmd "/" test-tool path-utils real_path "///" && + test_cmp_cmd "/$nopath" test-tool path-utils real_path "///$nopath" && # Find an existing top-level directory for the remaining tests: d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") && - test "$d" = "$(test-tool path-utils real_path "//$d")" && - test "$d/$nopath" = "$(test-tool path-utils real_path "//$d/$nopath")" + test_cmp_cmd "$d" test-tool path-utils real_path "//$d" && + test_cmp_cmd "$d/$nopath" test-tool path-utils real_path "//$d/$nopath" ' test_expect_success 'real path removes other extra slashes' ' nopath="hopefully-absent-path" && # Find an existing top-level directory for the remaining tests: d=$(pwd -P | sed -e "s|^\([^/]*/[^/]*\)/.*|\1|") && - test "$d" = "$(test-tool path-utils real_path "$d///")" && - test "$d/$nopath" = "$(test-tool path-utils real_path "$d///$nopath")" + test_cmp_cmd "$d" test-tool path-utils real_path "$d///" && + test_cmp_cmd "$d/$nopath" test-tool path-utils real_path "$d///$nopath" ' test_expect_success SYMLINKS 'real path works on symlinks' ' @@ -227,19 +232,19 @@ test_expect_success SYMLINKS 'real path works on symlinks' ' mkdir third && dir="$(cd .git && pwd -P)" && dir2=third/../second/other/.git && - test "$dir" = "$(test-tool path-utils real_path $dir2)" && + test_cmp_cmd "$dir" test-tool path-utils real_path $dir2 && file="$dir"/index && - test "$file" = "$(test-tool path-utils real_path $dir2/index)" && + test_cmp_cmd "$file" test-tool path-utils real_path $dir2/index && basename=blub && - test "$dir/$basename" = "$(cd .git && test-tool path-utils real_path "$basename")" && + test_cmp_cmd "$dir/$basename" test-tool -C .git path-utils real_path "$basename" && ln -s ../first/file .git/syml && sym="$(cd first && pwd -P)"/file && - test "$sym" = "$(test-tool path-utils real_path "$dir2/syml")" + test_cmp_cmd "$sym" test-tool path-utils real_path "$dir2/syml" ' test_expect_success SYMLINKS 'prefix_path works with absolute paths to work tree symlinks' ' ln -s target symlink && - test "$(test-tool path-utils prefix_path prefix "$(pwd)/symlink")" = "symlink" + test_cmp_cmd "symlink" test-tool path-utils prefix_path prefix "$(pwd)/symlink" ' test_expect_success 'prefix_path works with only absolute path to work tree' ' @@ -255,7 +260,7 @@ test_expect_success 'prefix_path rejects absolute path to dir with same beginnin test_expect_success SYMLINKS 'prefix_path works with absolute path to a symlink to work tree having same beginning as work tree' ' git init repo && ln -s repo repolink && - test "a" = "$(cd repo && test-tool path-utils prefix_path prefix "$(pwd)/../repolink/a")" + test_cmp_cmd "a" test-tool -C repo path-utils prefix_path prefix "$(cd repo && pwd)/../repolink/a" ' relative_path /foo/a/b/c/ /foo/a/b/ c/ diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 6da7273f1d5..63e46442eb6 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -1366,6 +1366,24 @@ test_cmp_rev () { fi } +# test_cmp_cmd is a convenience helper for doing the more verbose: +# +# echo something >expect && +# >actual && +# test_cmp expect actual +# +# As: +# +# test_cmp_cmd something +test_cmp_cmd () { + local expect="$1" && + shift && + printf "%s\n" "$expect" >expect && + "$@" >actual 2>err && + test_must_be_empty err + test_cmp expect actual +} + # Compare paths respecting core.ignoreCase test_cmp_fspath () { if test "x$1" = "x$2" From patchwork Thu Jul 21 06:51:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12924796 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 1B555C433EF for ; Thu, 21 Jul 2022 06:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232179AbiGUGwL (ORCPT ); Thu, 21 Jul 2022 02:52:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231972AbiGUGv5 (ORCPT ); Thu, 21 Jul 2022 02:51:57 -0400 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0FB4735B1 for ; Wed, 20 Jul 2022 23:51:55 -0700 (PDT) Received: by mail-wm1-x329.google.com with SMTP id c187-20020a1c35c4000000b003a30d88fe8eso2673559wma.2 for ; Wed, 20 Jul 2022 23:51:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FXEF0/zGnTx4FKulkwLg2SyqpooceB1JYEy/R0Q7Bdg=; b=qtT5vxNSoZ3PKQ8x9CYnCTe58UwJvoOARvCLmIotSKWbeg9JgVheFRgVbXaope26OU 1/OmQzhWwOVNd1HORMjvYXI9A8Di0qBhKIPlv81VAnaj2eWzIIyB7kPeIBOk+B7D3IlZ qZvSgcypdeaN4VyJs+UyJAiaizuFYrqV5jJFFuXWCPfku/ktGcNo8qC8DfZboLe6VtWG 5AFXqjsPX+f+H0lDxBaHsp6CQDIlH/DLmGowIusxea2owT7ns8cfu19tcg86/IS45gzj RbBtGAgYV1EgGft1ZVZtCYgqBk8odoA24RC7SCgy7Fh0KT150Hil/hGtd4svwABi4kwF elpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FXEF0/zGnTx4FKulkwLg2SyqpooceB1JYEy/R0Q7Bdg=; b=1KRMpU2h0QL4NyDxUGyQRTDQr6BnevMzm8iDALE4Uwf7NJiRLC0om9X8z+hNPy+QDA WQC479cnKxVwftJI9Lzq4OZz05f4ydUCJIoVFZ0hENzBqc4G4TgfzpUpXCDnfIQ70Jmz JBnBUp3BpgRc6usWNBZ4/UslH8RwwD5rEE6P9wI9pLYfIUmAzOfTlYMKyRYy+Nr3qOAZ 4bvXMVz8IpzFHCk6w/PQv1eO3lTL9iYB1S/f2r6NCPK4Nv6Bh/dZz0K13kvBcplQrQLw VxSrsF9sxeDE7fAZqNq+fyOePCs95psCfXCeliyrWYx62908Xk2xlhpOC0D7XUGPIPMK Ebyg== X-Gm-Message-State: AJIora9yc5nqOJqxpHso+rxJpj7ieOncPdQxd4wmN8zK+o9UNMCW2WOx 0gDn7pmkeq4OAB17n/S1a8lvzHVxTsD4CQ== X-Google-Smtp-Source: AGRyM1tOoCBl8GdVS3XJrqqJm7Oik+M/OeA5dBhJ7JEmJpT/N/oHBKJXzIGudbotrctypsxGAaJSjw== X-Received: by 2002:a05:600c:1e1e:b0:3a3:b97:91b3 with SMTP id ay30-20020a05600c1e1e00b003a30b9791b3mr6936310wmb.25.1658386314042; Wed, 20 Jul 2022 23:51:54 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n124-20020a1c2782000000b003a2c67aa6c0sm1006746wmn.23.2022.07.20.23.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:51:53 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 5/6] merge tests: don't ignore "rev-parse" exit code in helper Date: Thu, 21 Jul 2022 08:51:42 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1095.g64a1e8362fd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change the verify_mergeheads() helper the check the exit code of "git rev-parse". The "$rest" variable added in 274a5c06d52 (merge: record tag objects without peeling in MERGE_HEAD, 2011-11-07) wasn't being used. Such a thing is needed to support the .git/MERGE_HEAD format in general, but in this case we have no such addition to the line. So let's compare with "test_cmp" instead, we can always add back this "$rest" parsing if it's needed in the future. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t7600-merge.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index f0f6fda150b..3682d6f9d4e 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -102,12 +102,11 @@ verify_parents () { } verify_mergeheads () { - test_write_lines "$@" >mergehead.expected && - while read sha1 rest + for rev in "$@" do - git rev-parse $sha1 - done <.git/MERGE_HEAD >mergehead.actual && - test_cmp mergehead.expected mergehead.actual + git rev-parse $rev || return 1 + done >mergehead.expected && + test_cmp mergehead.expected .git/MERGE_HEAD } verify_no_mergehead () { From patchwork Thu Jul 21 06:51:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 12924797 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 B47EAC43334 for ; Thu, 21 Jul 2022 06:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232190AbiGUGwM (ORCPT ); Thu, 21 Jul 2022 02:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbiGUGv6 (ORCPT ); Thu, 21 Jul 2022 02:51:58 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF1E25E320 for ; Wed, 20 Jul 2022 23:51:56 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id b6so478375wmq.5 for ; Wed, 20 Jul 2022 23:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OIuPs1VnBLMTS8tPZZf7HQTHzw1xX62Sct060lnv1AU=; b=dHAwkxTXLheBNMnBgLtdFCAvxjGNV7aFW973OjXIcg/VlO5XFdHrRri8U0sow8uMxR TfHTrN3EW042hCF7Z3zrnWVoyr2MXC3SFe6IDvut1vexKF7V7spOA93HjEVfhiONabyl PeVpn8nYQrVovi1sEGooFtO6F/EIX0iOT3hqnZSDW1MO+fQEnbLD4fVeKzLLvLiHd8MP VcoWWijM+2hpt1VkaueGg8udRl5n4izgEy3y7y7KsyRC8jKbtYUPB+I0YP1i+PBbZ+FF FYffiMWd7hB/sfNDN7VfPSJTBiWMxD9kpABNk8tPVH5AXvooUn5kNgh76ITPlbKO84Te 4rmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OIuPs1VnBLMTS8tPZZf7HQTHzw1xX62Sct060lnv1AU=; b=bkh96VThTu8UbkGaqkYg8+O8tXIh+KuQXZIkVHQuKe18I1VVaNdHYLfZ08F9vT5zNm lw4tJCr8qzeya9GweDab6CPnKNLFEtTAJ8FY66fVCkvNyRWY1xpoMOPq0uksVjwvL+YX UkWAddzu6A4oY6XZ2wHDFw2s6WvTpW/1EHVvkNMn3YAnwbg2hpVprwmh/QRDyTmGEvB3 0rD5rhh8GmBF60CutvgzLsXa9sb0DuZlIL/oCk5aDVS8wXl+uzn6t3N/Z6ag2F0H885j YpNQWnbWXPTlPMxHB+NEO297Y50VEr+nfdHwRkLJn3IoQzrRzfn4LgznnKyKpJnFJkIC VqSw== X-Gm-Message-State: AJIora9vaxPw320mr8wmHBitW9EjPkOQy61+Mf+F/AuYUObFi1jCuD3a lwV9wvSLe/NnikWzwpedhLNOSPjC++Brbw== X-Google-Smtp-Source: AGRyM1ve63IWEyMFEXQehSBKgq0QEmF0AZe1WNf1UDA23xLxMEeTwpOdZlDgIz5rfcTZBDsK95D6aA== X-Received: by 2002:a05:600c:1d1b:b0:3a3:e2:42d1 with SMTP id l27-20020a05600c1d1b00b003a300e242d1mr6813394wms.137.1658386314883; Wed, 20 Jul 2022 23:51:54 -0700 (PDT) Received: from vm.nix.is (vm.nix.is. [2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id n124-20020a1c2782000000b003a2c67aa6c0sm1006746wmn.23.2022.07.20.23.51.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jul 2022 23:51:54 -0700 (PDT) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 6/6] log tests: don't use "exit 1" outside a sub-shell Date: Thu, 21 Jul 2022 08:51:43 +0200 Message-Id: X-Mailer: git-send-email 2.37.1.1095.g64a1e8362fd In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Change an "exit 1" added in ac52d9410e5 (t4205: cover `git log --reflog -z` blindspot, 2019-11-19) to use "return 1" instead, which curiously was done in an adjacent test case added in the same commit. Using "exit 1" outside a sub-shell will cause the test framework itself to exit on failure, which isn't what we want to do here. This issue was spotted with the in-flight "GIT_TEST_PASSING_SANITIZE_LEAK=check" test mode[1]. This "git show" invocation currently leaks memory, and we'd thus "exit 1". This change was initially part of that topic[2] to demonstrate the correctness of the "check" implementation. 1. https://lore.kernel.org/git/patch-07.10-0961df2ab6c-20220719T205710Z-avarab@gmail.com/ 2. https://lore.kernel.org/git/patch-10.10-9cedf0cb0e2-20220719T205710Z-avarab@gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t4205-log-pretty-formats.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index e448ef2928a..0404491d6ee 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -156,7 +156,7 @@ test_expect_success 'NUL termination with --reflog --pretty=oneline' ' for r in $revs do git show -s --pretty=oneline "$r" >raw && - cat raw | lf_to_nul || exit 1 + cat raw | lf_to_nul || return 1 done >expect && # the trailing NUL is already produced so we do not need to # output another one