From patchwork Tue Mar 28 17:39:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13191423 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 4818FC76196 for ; Tue, 28 Mar 2023 17:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbjC1Rju (ORCPT ); Tue, 28 Mar 2023 13:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjC1Rji (ORCPT ); Tue, 28 Mar 2023 13:39:38 -0400 Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90D8D520 for ; Tue, 28 Mar 2023 10:39:36 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id ca2-20020a056830610200b006a11ab58c3fso6108876otb.4 for ; Tue, 28 Mar 2023 10:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680025176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Asn3uzUI7K34zyY0EobVtH/3PMaw9aapstIAZFkCEcs=; b=OI8Cp5mBjDMlA6NrVoULfuJF8qDGee9rhAsQQNRRNuUv8lW4vHQJP6ONu4P0D04ghY h0/F7cFwRBP2Kv0SobcGYeh9ctDD/vPC/v3a3wawoGX8c3T2U7xmvDApm5jjw1ah5mbl D+Ei6WH+kiQPuE24Z5KAus7IKIz27s4GfHdWvnx5ApoGTjW6oOhXqIgWyFXLC21jCwM2 1mAwes2/SXqOpLsxaUp++/2C/MGmjqsYRQDp16M6G/PjrDRKoNrvhK1QYVtaJe5/jsFS pAortc8pkUrVAF7ufMQSrqQmc1dd4YVfdmBpYqyb+zpxp34uLoK9QG2oKeIQhxHubMON mghA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680025176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Asn3uzUI7K34zyY0EobVtH/3PMaw9aapstIAZFkCEcs=; b=O0hznMStsvoGjvyIu2Fnr/IA+KZoy/yvd3AMpfrJsTEq+w5uA8rleUrfRa9rSYj3S2 EuTd3iJdTWLPdNx7S25HshXnULGhPOVx5o7joFpFi4V5gZT6NugabO4nVsq/9GD/hpc1 HeYNbkvOdSiUScwnJAxQG0qLHaE0QFOucn81j9hjXDoGg+EwN5A8J0Wq09tO2zK9gNCA /6X0cbFPBw9IlpsL3uvTerhMyMzGVKKHkDZmTTr9EfdJHvLChwAZIRA7vtFmw6PQedNa UgsPJr5KzdYkUARoo/sIx+c49GzBNK0Vqyu/p5tUmzngwF404IGnv/0B9XB3/2ZJZfOt viBw== X-Gm-Message-State: AAQBX9f+PRdnALe8+7qqd92k8STgDX0NskyZ2ooMOzxU+1f2/HYNcylR KrHVbF7SM68lvDdNMiLvZE5lzRYzFTs= X-Google-Smtp-Source: AKy350YgIi+Yjid0AqNn/ZFDUxSG8rYbq36LVYX194c2egANRfYcHmfxpxyB66+0YJ2VndIRPxC++g== X-Received: by 2002:a05:6830:114c:b0:6a1:3cc7:170d with SMTP id x12-20020a056830114c00b006a13cc7170dmr3856694otq.10.1680025175823; Tue, 28 Mar 2023 10:39:35 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id x10-20020a9d6d8a000000b006a1561e336dsm1032434otp.49.2023.03.28.10.39.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:39:35 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Felipe Contreras Subject: [PATCH 1/6] test: fix build for zsh Date: Tue, 28 Mar 2023 11:39:27 -0600 Message-Id: <20230328173932.3614601-2-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com> References: <20230328173932.3614601-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Felipe Contreras --- t/lib-bash.sh | 2 +- t/test-lib.sh | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/t/lib-bash.sh b/t/lib-bash.sh index b0b6060929..798b6d0265 100644 --- a/t/lib-bash.sh +++ b/t/lib-bash.sh @@ -10,7 +10,7 @@ elif type bash >/dev/null 2>&1 then # execute in full-on bash mode unset POSIXLY_CORRECT - exec bash "$0" "$@" + exec bash "${ZSH_ARGZERO-$0}" "$@" else echo '1..0 #SKIP skipping bash completion tests; bash not available' exit 0 diff --git a/t/test-lib.sh b/t/test-lib.sh index 62136caee5..cc705df981 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -15,6 +15,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/ . +if test -n "${ZSH_VERSION-}" +then + emulate sh + ARGZERO="$ZSH_ARGZERO" +else + ARGZERO="$0" +fi + # Test the binaries we have just built. The tests are kept in # t/ subdirectory and are run in 'trash directory' subdirectory. if test -z "$TEST_DIRECTORY" @@ -310,7 +318,7 @@ then fi TEST_STRESS_JOB_SFX="${GIT_TEST_STRESS_JOB_NR:+.stress-$GIT_TEST_STRESS_JOB_NR}" -TEST_NAME="$(basename "$0" .sh)" +TEST_NAME="$(basename "$ARGZERO" .sh)" TEST_NUMBER="${TEST_NAME%%-*}" TEST_NUMBER="${TEST_NUMBER#t}" TEST_RESULTS_DIR="$TEST_OUTPUT_DIRECTORY/test-results" @@ -388,7 +396,7 @@ then { test -z "$stress_limit" || test $cnt -le $stress_limit ; } do - $TEST_SHELL_PATH "$0" "$@" >"$TEST_RESULTS_BASE.stress-$job_nr.out" 2>&1 & + $TEST_SHELL_PATH "$ARGZERO" "$@" >"$TEST_RESULTS_BASE.stress-$job_nr.out" 2>&1 & test_pid=$! if wait $test_pid @@ -442,7 +450,7 @@ then # from any previous runs. >"$GIT_TEST_TEE_OUTPUT_FILE" - (GIT_TEST_TEE_STARTED=done ${TEST_SHELL_PATH} "$0" "$@" 2>&1; + (GIT_TEST_TEE_STARTED=done ${TEST_SHELL_PATH} "$ARGZERO" "$@" 2>&1; echo $? >"$TEST_RESULTS_BASE.exit") | tee -a "$GIT_TEST_TEE_OUTPUT_FILE" test "$(cat "$TEST_RESULTS_BASE.exit")" = 0 exit @@ -467,7 +475,7 @@ then then : Executed by a Bash version supporting BASH_XTRACEFD. Good. else - echo >&2 "warning: ignoring -x; '$0' is untraceable without BASH_XTRACEFD" + echo >&2 "warning: ignoring -x; '$ARGZERO' is untraceable without BASH_XTRACEFD" trace= fi fi @@ -1595,7 +1603,7 @@ fi if test "${GIT_TEST_CHAIN_LINT:-1}" != 0 then - "$PERL_PATH" "$TEST_DIRECTORY/chainlint.pl" "$0" || + "$PERL_PATH" "$TEST_DIRECTORY/chainlint.pl" "$ARGZERO" || BUG "lint error (see '?!...!? annotations above)" fi @@ -1637,7 +1645,7 @@ fi # in subprocesses like git equals our $PWD (for pathname comparisons). cd -P "$TRASH_DIRECTORY" || BAIL_OUT "cannot cd -P to \"$TRASH_DIRECTORY\"" -start_test_output "$0" +start_test_output "$ARGZERO" # Convenience # A regexp to match 5 and 35 hexdigits From patchwork Tue Mar 28 17:39:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13191426 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 93BF0C77B61 for ; Tue, 28 Mar 2023 17:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjC1Rjw (ORCPT ); Tue, 28 Mar 2023 13:39:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbjC1Rjk (ORCPT ); Tue, 28 Mar 2023 13:39:40 -0400 Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D57FAAF09 for ; Tue, 28 Mar 2023 10:39:38 -0700 (PDT) Received: by mail-ot1-x332.google.com with SMTP id l39-20020a9d1b2a000000b006a121324abdso5203529otl.7 for ; Tue, 28 Mar 2023 10:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680025178; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dIPYckbJ1PMG0Y5FdCo4De/KmihcIXIszuI8XbFEBzE=; b=gOSvwlOtU5iiouWEMDAvrAWcJqcXLeSLggTQCHuFRr4iXRfy2FMPj5hdELqIczGSmO ADMnsbgQDSPGY3VGaQN3+Jtkz10HWJzGjWwK2yBeGH7i6cw2QHinvzcbCzjgYJvQsevi 2oEt5e6tjN/ZyxA/CAjN39gvfsx7B46oXKhOnbegpSe1CBb3xPQGipd9TBChV9QKHQ1X MoDhdn+qjGLI6sxcXBLM2G7lRf/nwDX2hYn2yBnV1nCabp3B0bpFt1jlniEkgDXSEM+3 sb2dYLBqhfpO50PvLU0PB3AI7k+bbnHgVmloH2EP6+TxXvBhkVEFCV+tJrqkLSupPt6D cqbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680025178; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dIPYckbJ1PMG0Y5FdCo4De/KmihcIXIszuI8XbFEBzE=; b=lnTmVBd5f7egO6i5ga6GkgF2dBqmw8ghiXdfNBqU8C77XO0TKGkzHPN1Xx5oVK7MyS z9wseH2RdEElirjEknQEJziRLKUbHK0ntQVg5FiAN7zoTp+BN+38kkS7Lk1Z1MrW7GWI ueroSVDkrq8ORN4Lg+m/9lTAHCPVLE6EGWD0V0kXEPP9BOlX953hSFvOc4L1/juE18n1 jHrfJTs6tsuwzmoxvuxaohGRgUJMzsZLAima2+Ga8h4FdYFv8ONgsJKRRVRDPqAZlYPK 0FbmqcfpTYnVE6eBE8K63eFvRQmMpoZ4DpSl9GzpZawCV5tg8GsMSyuYKvcfLNEmq2gC ztCw== X-Gm-Message-State: AAQBX9ePyIgTB0Ugw3Uz0MM/t+HLj5WWFysxhOgMB40727ioG2EJozy9 aLpGAQqidDGxv9j5deTLlJlR92oFgVY= X-Google-Smtp-Source: AKy350ZMXT6cWHeBg/12U9JGSssAoeDuanaZC07LUEZ/w5w0WSmXLNqeDlNTy3Jpt2v6J3DwcGyn8g== X-Received: by 2002:a9d:6857:0:b0:6a1:380a:eb0a with SMTP id c23-20020a9d6857000000b006a1380aeb0amr4595651oto.9.1680025177942; Tue, 28 Mar 2023 10:39:37 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id o9-20020a9d7649000000b00697be532609sm13075716otl.73.2023.03.28.10.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:39:36 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Felipe Contreras Subject: [PATCH 2/6] test: avoid `stat` variable Date: Tue, 28 Mar 2023 11:39:28 -0600 Message-Id: <20230328173932.3614601-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com> References: <20230328173932.3614601-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It has special meaning in zsh. Signed-off-by: Felipe Contreras --- t/t0001-init.sh | 4 ++-- t/t3432-rebase-fast-forward.sh | 4 ++-- t/t4013-diff-various.sh | 6 +++--- t/t5512-ls-remote.sh | 4 ++-- t/t5516-fetch-push.sh | 8 ++++---- t/test-lib.sh | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/t/t0001-init.sh b/t/t0001-init.sh index 30a6edca1d..88c9de8f53 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -362,12 +362,12 @@ test_lazy_prereq GETCWD_IGNORES_PERMS ' cd $base/dir && test-tool getcwd ) - status=$? + stat=$? chmod 700 $base && rm -rf $base || BUG "cannot clean $base" - return $status + return $stat ' check_long_base_path () { diff --git a/t/t3432-rebase-fast-forward.sh b/t/t3432-rebase-fast-forward.sh index 7f1a5dd3de..49ecf8f18b 100755 --- a/t/t3432-rebase-fast-forward.sh +++ b/t/t3432-rebase-fast-forward.sh @@ -41,7 +41,7 @@ test_rebase_same_head () { } test_rebase_same_head_ () { - status="$1" && + stat="$1" && shift && what="$1" && shift && @@ -57,7 +57,7 @@ test_rebase_same_head_ () { else msg="git rebase$flag $* with $changes is $what with $cmp HEAD" fi && - test_expect_$status "$msg" " + test_expect_$stat "$msg" " if test $abbreviate -eq 1 then test_config rebase.abbreviateCommands true diff --git a/t/t4013-diff-various.sh b/t/t4013-diff-various.sh index 5de1d19075..8f82946c2f 100755 --- a/t/t4013-diff-various.sh +++ b/t/t4013-diff-various.sh @@ -178,7 +178,7 @@ process_diffs () { V=$(git version | sed -e 's/^git version //' -e 's/\./\\./g') while read magic cmd do - status=success + stat=success case "$magic" in '' | '#'*) continue ;; @@ -188,7 +188,7 @@ do case "$magic" in noellipses) ;; failure) - status=failure + stat=failure magic= label="$cmd" ;; *) @@ -203,7 +203,7 @@ do expect="$TEST_DIRECTORY/t4013/diff.$test" actual="$pfx-diff.$test" - test_expect_$status "git $cmd # magic is ${magic:-(not used)}" ' + test_expect_$stat "git $cmd # magic is ${magic:-(not used)}" ' { echo "$ git $cmd" case "$magic" in diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index 20d063fb9a..88f0f81baf 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -167,9 +167,9 @@ test_expect_success 'confuses pattern as remote when no remote specified' ' test_expect_success 'die with non-2 for wrong repository even with --exit-code' ' { git ls-remote --exit-code ./no-such-repository - status=$? + stat=$? } && - test $status != 2 && test $status != 0 + test $stat != 2 && test $stat != 0 ' test_expect_success 'Report success even when nothing matches' ' diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 19ebefa5ac..ed8b676156 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1732,9 +1732,9 @@ test_expect_success 'updateInstead with push-to-checkout hook' ' git update-index -q --refresh && git read-tree -u -m HEAD "$1" || { - status=$? + stat=$? echo >&2 read-tree failed - exit $status + exit $stat } EOF @@ -1800,9 +1800,9 @@ test_expect_success 'updateInstead with push-to-checkout hook' ' no) git read-tree -u -m "$1" ;; esac || { - status=$? + stat=$? echo >&2 read-tree failed - exit $status + exit $stat } EOF diff --git a/t/test-lib.sh b/t/test-lib.sh index cc705df981..621a10941d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1866,12 +1866,12 @@ test_lazy_prereq SANITY ' ! test -r SANETESTD.1/x && ! rm SANETESTD.1/x && ! test -f SANETESTD.2/x - status=$? + stat=$? chmod +rwx SANETESTD.1 SANETESTD.2 && rm -rf SANETESTD.1 SANETESTD.2 || BUG "cannot clean SANETESTD" - return $status + return $stat ' test FreeBSD != $uname_s || GIT_UNZIP=${GIT_UNZIP:-/usr/local/bin/unzip} From patchwork Tue Mar 28 17:39:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13191422 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 7F68AC6FD18 for ; Tue, 28 Mar 2023 17:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229575AbjC1Rjx (ORCPT ); Tue, 28 Mar 2023 13:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjC1Rjm (ORCPT ); Tue, 28 Mar 2023 13:39:42 -0400 Received: from mail-oo1-xc33.google.com (mail-oo1-xc33.google.com [IPv6:2607:f8b0:4864:20::c33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88BE5AF09 for ; Tue, 28 Mar 2023 10:39:41 -0700 (PDT) Received: by mail-oo1-xc33.google.com with SMTP id j12-20020a4ab1cc000000b0053e6062a9eeso459860ooo.8 for ; Tue, 28 Mar 2023 10:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680025180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XzAx97jPCNAfA53+aWkTQgMlhYCN1H9FOJiyEb1Qiag=; b=Wxj45YDupyncS0z9W/GaH+5iXeiU32knxNPbCQR4PSb38LomZReX4aURLD9KXADhjM FSchQXyBoTcGTcfFTN1TSmh2B08O4Z6DfGEnI1q7+FnHyYDHB8FuP6+hyj/Iz131pfgq a3U6/Jb8NPt/P1Jj4STmQabQKd1iNETw+7KsF//1yfaAFdOQ91snID2BCzI/c6suMZl9 dOXQ4xVg22d4foI2503C5UkEwad2diuIm8Fvtr6XwKnZW3cEjWov3olCFxENd9uW1die HK3iNuuYtknl+Q1C9X9i6qrWvHyHi5BC9ECCo/Mj7V4MPEgWtGIOdElRNKPd+n7a1APT 8D4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680025180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XzAx97jPCNAfA53+aWkTQgMlhYCN1H9FOJiyEb1Qiag=; b=BBhYU2Z1FdIlcdK2SIKiF2XPvcTP5HDFY4A89e1iz+vIZydzXYOmrdt3XDanuDetkl t2pfc+VqbHixFI/1y3Sq+KlKF5D/eLHlcHuP5OPowHY0p9ttihdwQhaE/6GX1ep3JjBW /Iml2un8pMqCBw1T36LyZu4DWyy6eSkksjBE9PO65pS5Vc1fc1Re+ID0n5dYG31sXjBz zUnPhyRlAANV5GI04qQYKmZpH+L25g884bjQTTV2WJ4BMha69VR0fnkBICpMpZ4lEdHQ ErojBJEVNnSmlu0/li3YCVldXOs3w0yGdGEo0SAdeW4BQdL6ydmkQ2vteS6v87yjt/Z6 hSZg== X-Gm-Message-State: AO0yUKWV7EHSR8i7ReP+FA7Pti+8H4YQGQu2lUnxyLyoGW0hjY1JElrR Uj4bh4RbnJw2KPcETOmyyCLEsbhNDt8= X-Google-Smtp-Source: AK7set/CTaqwMJzx6oBkKDn7REKB8pQ5gPdctyhDfE0q31Pbw+gGHJK7xtjyuVtL2oJf7M9IoZoB1Q== X-Received: by 2002:a4a:5554:0:b0:52f:42ed:6d6a with SMTP id e81-20020a4a5554000000b0052f42ed6d6amr8837155oob.6.1680025180451; Tue, 28 Mar 2023 10:39:40 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id a31-20020a4a98a2000000b005251f71250dsm12665683ooj.37.2023.03.28.10.39.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:39:39 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Felipe Contreras Subject: [PATCH 3/6] test: avoid `options` variable Date: Tue, 28 Mar 2023 11:39:29 -0600 Message-Id: <20230328173932.3614601-4-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com> References: <20230328173932.3614601-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It has a special meaning in zsh. Signed-off-by: Felipe Contreras --- t/annotate-tests.sh | 10 +++++----- t/t4051-diff-function-context.sh | 4 ++-- t/t9300-fast-import.sh | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh index f1b9a6ce4d..3b57d4dbb5 100644 --- a/t/annotate-tests.sh +++ b/t/annotate-tests.sh @@ -15,19 +15,19 @@ fi check_count () { head= && file='file' && - options= && + args= && while : do case "$1" in -h) head="$2"; shift; shift ;; -f) file="$2"; shift; shift ;; - -L*) options="$options $(sanitize_L "$1")"; shift ;; - -*) options="$options $1"; shift ;; + -L*) args="$args $(sanitize_L "$1")"; shift ;; + -*) args="$args $1"; shift ;; *) break ;; esac done && - echo "$PROG $options $file $head" >&4 && - $PROG $options $file $head >actual && + echo "$PROG $args $file $head" >&4 && + $PROG $args $file $head >actual && perl -e ' my %expect = (@ARGV); my %count = map { $_ => 0 } keys %expect; diff --git a/t/t4051-diff-function-context.sh b/t/t4051-diff-function-context.sh index 725278ad19..3bf4f0b6b0 100755 --- a/t/t4051-diff-function-context.sh +++ b/t/t4051-diff-function-context.sh @@ -30,10 +30,10 @@ last_context_line () { check_diff () { name=$1 desc=$2 - options="-W $3" + args="-W $3" test_expect_success "$desc" ' - git diff $options "$name^" "$name" >"$name.diff" + git diff $args "$name^" "$name" >"$name.diff" ' test_expect_success ' diff applies' ' diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh index aa55b41b9a..c30503870f 100755 --- a/t/t9300-fast-import.sh +++ b/t/t9300-fast-import.sh @@ -3222,7 +3222,7 @@ test_expect_success 'U: validate root delete result' ' # fast-import process is still running using background_import_still_running # *after* evaluating the test conditions. background_import_then_checkpoint () { - options=$1 + args=$1 input_file=$2 mkfifo V.input @@ -3234,7 +3234,7 @@ background_import_then_checkpoint () { rm V.output ( - git fast-import $options <&8 >&9 & + git fast-import $args <&8 >&9 & echo $! >&9 wait $! echo >&2 "background fast-import terminated too early with exit code $?" From patchwork Tue Mar 28 17:39:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13191427 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 A5393C761AF for ; Tue, 28 Mar 2023 17:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjC1Rjy (ORCPT ); Tue, 28 Mar 2023 13:39:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjC1Rjo (ORCPT ); Tue, 28 Mar 2023 13:39:44 -0400 Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 370B7AF09 for ; Tue, 28 Mar 2023 10:39:43 -0700 (PDT) Received: by mail-oi1-x22e.google.com with SMTP id y184so9556426oiy.8 for ; Tue, 28 Mar 2023 10:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680025182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T5G2N1remCHj5KibBcy3jcwP9yYLNU2WQLl5EGi31pk=; b=fv3X6Ju/LYxVq1OSF+THwFEvyNfaphL20ftjM1MQGrYpPJDpbhFsAkkihlgBuwL0Jq fTSwRA8V6SKb2j2AwVGzBD/eCBTu5RcqbVtGVYzZ5rP8AV5v15WeYKJMvanHK0mshAIt RbzaOB9dYTu7RUH3F5sdS2qnbuNlX4uii0Sk6I05bl+FhRFdFD5Srxc2zvOC27GYvHEE SymEYqi/3VUkFUwK5hqplayTviw70vgemJNxB0N8uJKzFKBuxwAWbvfpp2lpo/I0UJUq HuJ52fBfoLl1JZBrt8KNZ07vlEopMOnHeeE/BGXpFpxZsah6HDvi2JUW/5PUbJ1A064C cd9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680025182; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T5G2N1remCHj5KibBcy3jcwP9yYLNU2WQLl5EGi31pk=; b=T/XFMscyFJobyrQCiAIAZo6acEe0xj1SZKtoihC98PsWBlTaUTa+YHFAuqicOWulsE 6xrGZ6yavJV5IYnQGhmdwb3+Ws2qlLwWXvCO12J2rIIy4xdZha25V97iJzCqdk7yVdMh onXtCYThfsO8J7+4Ixs2uQWUHgfTsTKfDXa23FaCLXWQpXKskRuY28k5NxRBMltl8QaE SBAxPdlIYHBoRLMIwUcWx4CIejVLa/jOtlSsb1jsAs92iYlZb8rXUtyJYXrzbSQwKj+D 7N7DFJAWDTkU5iq8ipXdhDr5DUE2vp7Ox46GQEvap6e0O9YNQwJ0i6BeJGqgivtIcpms iTkA== X-Gm-Message-State: AAQBX9dWDGWRaCJw5/PF+BXX3uPRpDBVgDrw9heM57bIoDIAbWzQsV2Y EXhOHDLXqQKAM4xVbldAvvAgCXBmnew= X-Google-Smtp-Source: AKy350Z8/QqKPXuYXr2xz6trvSmvhDqYWVKVP0tC2ykIEluxFp+NOozImTS+aPEBJUBBSp3CjouwfQ== X-Received: by 2002:a54:4d04:0:b0:389:4b35:431e with SMTP id v4-20020a544d04000000b003894b35431emr2622843oix.29.1680025182198; Tue, 28 Mar 2023 10:39:42 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id t129-20020a4a5487000000b0049fd5c02d25sm12834106ooa.12.2023.03.28.10.39.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:39:41 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Felipe Contreras Subject: [PATCH 4/6] test: avoid `path` variable Date: Tue, 28 Mar 2023 11:39:30 -0600 Message-Id: <20230328173932.3614601-5-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com> References: <20230328173932.3614601-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In zsh it's linked to `PATH`. Signed-off-by: Felipe Contreras --- t/t0003-attributes.sh | 16 ++++++------ t/t1450-fsck.sh | 16 ++++++------ t/t3305-notes-fanout.sh | 12 ++++----- t/t4046-diff-unmerged.sh | 48 +++++++++++++++++------------------ t/t5329-pack-objects-cruft.sh | 8 +++--- 5 files changed, 50 insertions(+), 50 deletions(-) diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh index 89b306cb11..b956b2fc29 100755 --- a/t/t0003-attributes.sh +++ b/t/t0003-attributes.sh @@ -7,10 +7,10 @@ TEST_CREATE_REPO_NO_TEMPLATE=1 . ./test-lib.sh attr_check_basic () { - path="$1" expect="$2" git_opts="$3" && + fpath="$1" expect="$2" git_opts="$3" && - git $git_opts check-attr test -- "$path" >actual 2>err && - echo "$path: test: $expect" >expect && + git $git_opts check-attr test -- "$fpath" >actual 2>err && + echo "$fpath: test: $expect" >expect && test_cmp expect actual } @@ -20,18 +20,18 @@ attr_check () { } attr_check_quote () { - path="$1" quoted_path="$2" expect="$3" && + fpath="$1" quoted_path="$2" expect="$3" && - git check-attr test -- "$path" >actual && + git check-attr test -- "$fpath" >actual && echo "\"$quoted_path\": test: $expect" >expect && test_cmp expect actual } attr_check_source () { - path="$1" expect="$2" source="$3" git_opts="$4" && + fpath="$1" expect="$2" source="$3" git_opts="$4" && - git $git_opts check-attr --source $source test -- "$path" >actual 2>err && - echo "$path: test: $expect" >expect && + git $git_opts check-attr --source $source test -- "$fpath" >actual 2>err && + echo "$fpath: test: $expect" >expect && test_cmp expect actual && test_must_be_empty err } diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh index bca46378b2..489e03865c 100755 --- a/t/t1450-fsck.sh +++ b/t/t1450-fsck.sh @@ -589,9 +589,9 @@ test_expect_success 'fsck notices submodule entry pointing to null sha1' ' ) ' -while read name path pretty; do +while read name fpath pretty; do while read mode type; do - : ${pretty:=$path} + : ${pretty:=$fpath} test_expect_success "fsck notices $pretty as $type" ' ( git init $name-$type && @@ -603,7 +603,7 @@ while read name path pretty; do blob=$(git rev-parse :file) && tree=$(git rev-parse HEAD^{tree}) && value=$(eval "echo \$$type") && - printf "$mode $type %s\t%s" "$value" "$path" >bad && + printf "$mode $type %s\t%s" "$value" "$fpath" >bad && bad_tree=$(git mktree out && test_i18ngrep "warning.*tree $bad_tree" out @@ -674,8 +674,8 @@ create_repo_missing () { unrelated=$(echo unrelated | git hash-object --stdin -w) && git tag -m foo tag $unrelated && sha1=$(git rev-parse --verify "$1") && - path=$(echo $sha1 | sed 's|..|&/|') && - rm .git/objects/$path + fpath=$(echo $sha1 | sed 's|..|&/|') && + rm .git/objects/$fpath ) } @@ -781,11 +781,11 @@ test_expect_success 'fsck --name-objects' ' test_expect_success 'alternate objects are correctly blamed' ' test_when_finished "rm -rf alt.git .git/objects/info/alternates" && name=$(test_oid numeric) && - path=$(test_oid_to_path "$name") && + fpath=$(test_oid_to_path "$name") && git init --bare alt.git && echo "../../alt.git/objects" >.git/objects/info/alternates && - mkdir alt.git/objects/$(dirname $path) && - >alt.git/objects/$(dirname $path)/$(basename $path) && + mkdir alt.git/objects/$(dirname $fpath) && + >alt.git/objects/$(dirname $fpath)/$(basename $fpath) && test_must_fail git fsck >out 2>&1 && test_i18ngrep alt.git out ' diff --git a/t/t3305-notes-fanout.sh b/t/t3305-notes-fanout.sh index 1ec1fb6715..a0d8ec85a1 100755 --- a/t/t3305-notes-fanout.sh +++ b/t/t3305-notes-fanout.sh @@ -6,10 +6,10 @@ TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh path_has_fanout() { - path=$1 && + fpath=$1 && fanout=$2 && after_last_slash=$(($(test_oid hexsz) - $fanout * 2)) && - echo $path | grep -q -E "^([0-9a-f]{2}/){$fanout}[0-9a-f]{$after_last_slash}$" + echo $fpath | grep -q -E "^([0-9a-f]{2}/){$fanout}[0-9a-f]{$after_last_slash}$" } touched_one_note_with_fanout() { @@ -17,17 +17,17 @@ touched_one_note_with_fanout() { modification=$2 && # 'A' for addition, 'D' for deletion fanout=$3 && diff=$(git diff-tree --no-commit-id --name-status --root -r $notes_commit) && - path=$(echo $diff | sed -e "s/^$modification[\t ]//") && - path_has_fanout "$path" $fanout; + fpath=$(echo $diff | sed -e "s/^$modification[\t ]//") && + path_has_fanout "$fpath" $fanout; } all_notes_have_fanout() { notes_commit=$1 && fanout=$2 && git ls-tree -r --name-only $notes_commit | - while read path + while read fpath do - path_has_fanout $path $fanout || return 1 + path_has_fanout $fpath $fanout || return 1 done } diff --git a/t/t4046-diff-unmerged.sh b/t/t4046-diff-unmerged.sh index ffaf69335f..4998a1ce27 100755 --- a/t/t4046-diff-unmerged.sh +++ b/t/t4046-diff-unmerged.sh @@ -19,10 +19,10 @@ test_expect_success setup ' do for t in o x do - path="$b$o$t" && - case "$path" in ooo) continue ;; esac && - paths="$paths$path " && - p=" $path" && + fpath="$b$o$t" && + case "$fpath" in ooo) continue ;; esac && + paths="$paths$fpath " && + p=" $fpath" && case "$b" in x) echo "$m1$p" ;; esac && case "$o" in x) echo "$m2$p" ;; esac && case "$t" in x) echo "$m3$p" ;; esac || @@ -36,22 +36,22 @@ test_expect_success setup ' ' test_expect_success 'diff-files -0' ' - for path in $paths + for fpath in $paths do - >"$path" && - echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" || return 1 + >"$fpath" && + echo ":000000 100644 $ZERO_OID $ZERO_OID U $fpath" || return 1 done >diff-files-0.expect && git diff-files -0 >diff-files-0.actual && test_cmp diff-files-0.expect diff-files-0.actual ' test_expect_success 'diff-files -1' ' - for path in $paths + for fpath in $paths do - >"$path" && - echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" && - case "$path" in - x??) echo ":100644 100644 $blob1 $ZERO_OID M $path" + >"$fpath" && + echo ":000000 100644 $ZERO_OID $ZERO_OID U $fpath" && + case "$fpath" in + x??) echo ":100644 100644 $blob1 $ZERO_OID M $fpath" esac || return 1 done >diff-files-1.expect && git diff-files -1 >diff-files-1.actual && @@ -59,12 +59,12 @@ test_expect_success 'diff-files -1' ' ' test_expect_success 'diff-files -2' ' - for path in $paths + for fpath in $paths do - >"$path" && - echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" && - case "$path" in - ?x?) echo ":100644 100644 $blob2 $ZERO_OID M $path" + >"$fpath" && + echo ":000000 100644 $ZERO_OID $ZERO_OID U $fpath" && + case "$fpath" in + ?x?) echo ":100644 100644 $blob2 $ZERO_OID M $fpath" esac || return 1 done >diff-files-2.expect && git diff-files -2 >diff-files-2.actual && @@ -74,12 +74,12 @@ test_expect_success 'diff-files -2' ' ' test_expect_success 'diff-files -3' ' - for path in $paths + for fpath in $paths do - >"$path" && - echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" && - case "$path" in - ??x) echo ":100644 100644 $blob3 $ZERO_OID M $path" + >"$fpath" && + echo ":000000 100644 $ZERO_OID $ZERO_OID U $fpath" && + case "$fpath" in + ??x) echo ":100644 100644 $blob3 $ZERO_OID M $fpath" esac || return 1 done >diff-files-3.expect && git diff-files -3 >diff-files-3.actual && @@ -87,9 +87,9 @@ test_expect_success 'diff-files -3' ' ' test_expect_success 'diff --stat' ' - for path in $paths + for fpath in $paths do - echo " $path | Unmerged" || return 1 + echo " $fpath | Unmerged" || return 1 done >diff-stat.expect && echo " 0 files changed" >>diff-stat.expect && git diff --cached --stat >diff-stat.actual && diff --git a/t/t5329-pack-objects-cruft.sh b/t/t5329-pack-objects-cruft.sh index 303f7a5d84..86838d2b0f 100755 --- a/t/t5329-pack-objects-cruft.sh +++ b/t/t5329-pack-objects-cruft.sh @@ -28,8 +28,8 @@ basic_cruft_pack_tests () { git rev-list --objects --no-object-names base..loose | while read oid do - path="$objdir/$(test_oid_to_path "$oid")" && - printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$path")" || + fpath="$objdir/$(test_oid_to_path "$oid")" && + printf "%s %d\n" "$oid" "$(test-tool chmtime --get "$fpath")" || echo "object list generation failed for $oid" done | sort -k1 @@ -413,8 +413,8 @@ test_expect_success 'loose objects mtimes upsert others' ' git repack && tip="$(git rev-parse cruft)" && - path="$objdir/$(test_oid_to_path "$tip")" && - test-tool chmtime --get +1000 "$path" >expect && + fpath="$objdir/$(test_oid_to_path "$tip")" && + test-tool chmtime --get +1000 "$fpath" >expect && git checkout main && git branch -D other && From patchwork Tue Mar 28 17:39:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13191424 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 B6BADC77B6D for ; Tue, 28 Mar 2023 17:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229627AbjC1Rjz (ORCPT ); Tue, 28 Mar 2023 13:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjC1Rjp (ORCPT ); Tue, 28 Mar 2023 13:39:45 -0400 Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F9AED520 for ; Tue, 28 Mar 2023 10:39:44 -0700 (PDT) Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-177b78067ffso13521862fac.7 for ; Tue, 28 Mar 2023 10:39:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680025183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+08Tpkctwr4bpbEB1IHkRHbkiumXQdJpIwPg/a4nIJA=; b=FFaA3JA4rHvN45YkV3jv80IXHpgNoRNmeJCi9hZ6HvVPuOeMm4LvlhCAuebCO0Rwpp WSgjcsR+J6x7yZR1+IDnFrR7EUgSUhCYqaJuatMAg0YU5AdOqwGAtCZMWYSY2LxdfxVz 5KTp3TRr1tU+0VAu/l3u9Y2c7Vduwh7FgImzWccYd4X96kjiFClOX88CpBHY3ECYhoDl 4EuvDyWajVMFheDXCRsRFWm144N+dNqa/H79G5Xqicvm5M3YcYC2smq/9rfkFPgkUZdW GzxFN+gSHj3rz6Bq73UBL2Y1JUyYe43W+Jjy/OVqhRlN9BJCfJlFsmVG1WdVQRcRQMaD 1ylQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680025183; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+08Tpkctwr4bpbEB1IHkRHbkiumXQdJpIwPg/a4nIJA=; b=FtdR/i4q/PeseadWppy5xIRuBHqQfB6AH8K5qXplO8k4Q9CQVqvXLJ5QmwDMT8IG92 HJT2EHdQsTMeYMpVf1uhjUD96cc4icj16R1H6E6TVGEdLhiIPVRRcruJzFN5GgDnYseA LE6at6blki+rCGlg4KqRxrZWxkV43mXIhOPK5DmGQsqtxBHvZ20wg8Mon43vszWaONp8 465ALztpgaIAm3CetNn3tkj7EEcbQ6IPll9UkYH30gQjXuJwOel2KXKpXNEir08Xy9BK 6hSajUzXxFFJ86kncuSpzhAuTT9twAy3nR7r4YEJwLXFp8BR5qW+H4ueCKYlISDlW3XM 6VaA== X-Gm-Message-State: AAQBX9e9XUubBAln275vomxEWTyMeWpHDWkUfE2S29taPmYVgVB8FRx4 HhEvnkETL/H8p0sKn8EouOXBvpdL4cs= X-Google-Smtp-Source: AKy350afxCK9DBW9LvO+qT9bp3EBMJ8UwKfzQNpThJMIF0bOCHqM/UZ1u6cAoTCBjNXqmL72XKoItg== X-Received: by 2002:a05:6870:8a22:b0:177:ab68:aa9a with SMTP id p34-20020a0568708a2200b00177ab68aa9amr11701341oaq.1.1680025183680; Tue, 28 Mar 2023 10:39:43 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id u6-20020a056870b0c600b00172289de1besm10532671oag.18.2023.03.28.10.39.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:39:43 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Felipe Contreras Subject: [PATCH 5/6] test: hack for zsh Date: Tue, 28 Mar 2023 11:39:31 -0600 Message-Id: <20230328173932.3614601-6-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com> References: <20230328173932.3614601-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org See: https://www.zsh.org/mla/workers/2023/msg00336.html Signed-off-by: Felipe Contreras --- t/t4046-diff-unmerged.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t4046-diff-unmerged.sh b/t/t4046-diff-unmerged.sh index 4998a1ce27..ca31771070 100755 --- a/t/t4046-diff-unmerged.sh +++ b/t/t4046-diff-unmerged.sh @@ -21,7 +21,8 @@ test_expect_success setup ' do fpath="$b$o$t" && case "$fpath" in ooo) continue ;; esac && - paths="$paths$fpath " && + : hack for zsh && + { paths="$paths$fpath "; } && p=" $fpath" && case "$b" in x) echo "$m1$p" ;; esac && case "$o" in x) echo "$m2$p" ;; esac && From patchwork Tue Mar 28 17:39:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Contreras X-Patchwork-Id: 13191425 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 D2463C77B6C for ; Tue, 28 Mar 2023 17:40:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229656AbjC1Rj4 (ORCPT ); Tue, 28 Mar 2023 13:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbjC1Rjs (ORCPT ); Tue, 28 Mar 2023 13:39:48 -0400 Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F840D520 for ; Tue, 28 Mar 2023 10:39:46 -0700 (PDT) Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-17e140619fdso13504922fac.11 for ; Tue, 28 Mar 2023 10:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680025185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/ZHVcxrIiwB+5tBr4XBrXFT748jQEXsTLrvJrG4ZfW4=; b=araFP7DOxatKFDsa80BdEAQRIV5mICxUZ6q1zEtoZCF4vOUUjkirj6km240UdK0kpi KOnkyGkcIsNq5SMaubOqm1H67qJqI3QxVpgM1wpWjhPHYcmjIVkcuCN8Md0Q4jal+5XH zCSv/+TVht593bhDLN4Go3xnXDJj08B4d8QhATHlrVY0ft1WXQVIqLjm6+BVhLVjATqB BbYMYDj/YYg8hlnYryLujeCrBd9f2mUOiXtQVQxXB/oi9jIvXaw58Dyijp3/+5zj7EM4 xE9gkrNNUIAo0EKIISEZUh6CA98uf3YRwMyMAJfH0e0UYGwNA4Z/aB1majBVfMRLKd5L iwEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680025185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/ZHVcxrIiwB+5tBr4XBrXFT748jQEXsTLrvJrG4ZfW4=; b=5o9FlRJhuP6hC8lzfRlEVKIBkXbii8+OKU2PKYicEnkycb7zXErGpfvkvx1rvujfo1 /suM09NyLGyKDGejBo4F2wt8Dv9LXfEkjN7ldMTEmHUYXUKsQ6hsV41/g3NqLRqAlgRY JjsR19mbq1+mG+eL5kFRJ910Po9mVSJ4Z8Xtds+Ipy0L68vKKokt19slLjCHfzInBRSY Fsjx2TC5FmPZJDVYFKD6708o06WXR3scLeMmBq3AkUdwQLTOeGrK7t8TG5UUqgjcjoq1 vBod8fFm6Y95q97lI0AqyUv6Dx7bJHqi8edaHy2mpbgyarFEJNEowdYefenV2zu9tVDy K3mQ== X-Gm-Message-State: AAQBX9dRE4CpDEij6AMXw8u4sOzE0BB2DAqwQxycPOC3gY7pm4Syk5U9 t1i9f+EE1QElTAY/dvTV9sv1jCLgRMY= X-Google-Smtp-Source: AK7set9JhAE3ZdEaW80fsFhf5ha8VH40s5s9nLrGb8aJouTksM4IhOa6NZOOpL3rSW2ghx494cMvcA== X-Received: by 2002:a05:6870:b506:b0:172:7218:9c01 with SMTP id v6-20020a056870b50600b0017272189c01mr10818892oap.2.1680025185285; Tue, 28 Mar 2023 10:39:45 -0700 (PDT) Received: from localhost ([2806:2f0:4060:fff1:4ae7:daff:fe31:3285]) by smtp.gmail.com with ESMTPSA id eo17-20020a056870ec9100b0017aa2cd117asm11071445oab.13.2023.03.28.10.39.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Mar 2023 10:39:44 -0700 (PDT) From: Felipe Contreras To: git@vger.kernel.org Cc: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , =?utf-8?q?SZEDER_G=C3=A1bor?= , Eric Sunshine , Felipe Contreras Subject: [PATCH 6/6] mergetools: vimdiff: check for empty fields Date: Tue, 28 Mar 2023 11:39:32 -0600 Message-Id: <20230328173932.3614601-7-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.39.2.13.g1fb56cf030 In-Reply-To: <20230328173932.3614601-1-felipe.contreras@gmail.com> References: <20230328173932.3614601-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org In zsh 'foo#bar#' produces an empty field at the end. Signed-off-by: Felipe Contreras --- mergetools/vimdiff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mergetools/vimdiff b/mergetools/vimdiff index 06937acbf5..27d1644faf 100644 --- a/mergetools/vimdiff +++ b/mergetools/vimdiff @@ -87,7 +87,7 @@ gen_cmd_aux () { IFS=# for c in $(echo "$LAYOUT" | sed 's:.:&#:g') do - if test "$c" = " " + if test "$c" = " " || test -z "$c" then continue fi @@ -155,7 +155,7 @@ gen_cmd_aux () { do i=$(( i + 1 )) - if test "$c" = " " + if test "$c" = " " || test -z "$c" then continue fi