From patchwork Fri May 15 17:21:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 11552751 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68155139A for ; Fri, 15 May 2020 17:21:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51E722073E for ; Fri, 15 May 2020 17:21:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="rpBEPqTO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726313AbgEORVZ (ORCPT ); Fri, 15 May 2020 13:21:25 -0400 Received: from pb-smtp1.pobox.com ([64.147.108.70]:62686 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbgEORVY (ORCPT ); Fri, 15 May 2020 13:21:24 -0400 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 5ACDE4DCDD; Fri, 15 May 2020 13:21:22 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=zjRuNjd0Ps88AQ1wqrXyJQODT dA=; b=rpBEPqTOZWouM012ySPdr2/ZAomYlQWNbmI9S+pokAn+iZfyIzZNpJ23c xu0TXlreE/axIElGo9X9WlER4/fllBAWT4ZU2J5VxgtLhiOwQVFXJjOTYb59eoVW nLitbnaR7eTGVFVJsd2e4oJeYh5d45gWsdeybs6bj6JykQUjc0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=sasl; b=TcXkRblf7lNc9/teHMm AydIHjvNgOge+wAeWY5/FMzhYg70Sz4gIQQzsy9W6AqutCt17EeZ2YnIW/atXsGX wAxUF/Vr7fKcsTsnlWPx1/ayF6wt1bsSBfIA7mD/QEgJdji/K4V2WIIWHCsOsFfl /h9LN6RXJOjX5LycJxeUUtFA= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 4CAE64DCDB; Fri, 15 May 2020 13:21:22 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id C7A3F4DCD9; Fri, 15 May 2020 13:21:21 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= , Alban Gruin , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBE?= =?utf-8?b?YW5o?= , Johannes Schindelin Subject: [PATCH 1/2] Revert "t/test_lib: avoid naked bash arrays in file_lineno" Date: Fri, 15 May 2020 10:21:16 -0700 Message-Id: <20200515172117.155238-2-gitster@pobox.com> X-Mailer: git-send-email 2.27.0-rc0 In-Reply-To: <20200515172117.155238-1-gitster@pobox.com> References: <20200515172117.155238-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 7F1F19C2-96D0-11EA-BAC9-C28CBED8090B-77302942!pb-smtp1.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This reverts commit 303775a25f0b4ac5d6ad2e96eb4404c24209cad8; instead of trying to salvage the tap-breaking change, let's revert the whole thing for now for the upcoming release. The enhancement can be re-attempted in the next cycle. Signed-off-by: Junio C Hamano --- t/test-lib.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index baf94546da..1b221951a8 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -677,16 +677,14 @@ die () { file_lineno () { test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0 - eval ' - local i - for i in ${!BASH_SOURCE[*]} - do - case $i,"${BASH_SOURCE[$i]##*/}" in - 0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;; - *,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;; - esac - done - ' + local i + for i in ${!BASH_SOURCE[*]} + do + case $i,"${BASH_SOURCE[$i]##*/}" in + 0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;; + *,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;; + esac + done } GIT_EXIT_OK= From patchwork Fri May 15 17:21:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Junio C Hamano X-Patchwork-Id: 11552755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E5F1139A for ; Fri, 15 May 2020 17:21:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 477732073E for ; Fri, 15 May 2020 17:21:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=pobox.com header.i=@pobox.com header.b="oUgmEBJC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbgEORV2 (ORCPT ); Fri, 15 May 2020 13:21:28 -0400 Received: from pb-smtp20.pobox.com ([173.228.157.52]:53375 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbgEORV1 (ORCPT ); Fri, 15 May 2020 13:21:27 -0400 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 91563CD53E; Fri, 15 May 2020 13:21:26 -0400 (EDT) (envelope-from gitster@pobox.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; s=sasl; bh=3C+zAwX3eMoNJEuwu8HqDS1oy /Y=; b=oUgmEBJC5tdgaN4HLBBqjYcochyVQAZihlSAJIGmxIDx2Cz2ryToy+hlQ YwdECB74MPAAmOLCZt7B2OHqy8j0+fY315XzZ0tigb1kFSEep68kTcyXKdRvm7D8 EJekkRwHZy6DDTRDxOYzT/pweaJ6MaLzCSyGeDDsoFpgoAw9T8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; q=dns; s=sasl; b=Z1jieiYAO+d+goHYhZb ibr4XoVkcmgw9kh8i22nQWA9o4MPQKwbi1nvFvQ2bp+oPDZQdMnNpzq04yx5EF8V j5+ZR1HsxStfAZgI2Gd2rjfkS0xLFhLNBZo/Sa4LDy3fdyHQihzBqVG47EMzSAJX Xc7KTvGEAt3TPBS03HGcoc1k= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 881C1CD53D; Fri, 15 May 2020 13:21:26 -0400 (EDT) (envelope-from gitster@pobox.com) Received: from pobox.com (unknown [35.196.173.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id B3D39CD539; Fri, 15 May 2020 13:21:23 -0400 (EDT) (envelope-from gitster@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Cc: =?utf-8?q?Carlo_Marcelo_Arenas_Bel=C3=B3n?= , Alban Gruin , =?utf-8?b?xJBvw6BuIFRy4bqnbiBDw7RuZyBE?= =?utf-8?b?YW5o?= , Johannes Schindelin Subject: [PATCH 2/2] Revert "tests: when run in Bash, annotate test failures with file name/line number" Date: Fri, 15 May 2020 10:21:17 -0700 Message-Id: <20200515172117.155238-3-gitster@pobox.com> X-Mailer: git-send-email 2.27.0-rc0 In-Reply-To: <20200515172117.155238-1-gitster@pobox.com> References: <20200515172117.155238-1-gitster@pobox.com> MIME-Version: 1.0 X-Pobox-Relay-ID: 80438A86-96D0-11EA-8C19-B0405B776F7B-77302942!pb-smtp20.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org This reverts commit 662f9cf1548cf069cb819e9e95f224657015fcf9, which broke TAP output under bash. It can be re-attempted in a way that does not break TAP in the next cycle, but we do not want to worry about it at this late in the current cycle. Reported-by: Alban Gruin Signed-off-by: Junio C Hamano --- t/test-lib.sh | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index 1b221951a8..d36b6ddc62 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -675,18 +675,6 @@ die () { fi } -file_lineno () { - test -z "$GIT_TEST_FRAMEWORK_SELFTEST" && test -n "$BASH" || return 0 - local i - for i in ${!BASH_SOURCE[*]} - do - case $i,"${BASH_SOURCE[$i]##*/}" in - 0,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:$LINENO: ${1+$1: }"; return;; - *,t[0-9]*.sh) echo "t/${BASH_SOURCE[$i]}:${BASH_LINENO[$(($i-1))]}: ${1+$1: }"; return;; - esac - done -} - GIT_EXIT_OK= trap 'die' EXIT # Disable '-x' tracing, because with some shells, notably dash, it @@ -732,7 +720,7 @@ test_failure_ () { write_junit_xml_testcase "$1" " $junit_insert" fi test_failure=$(($test_failure + 1)) - say_color error "$(file_lineno error)not ok $test_count - $1" + say_color error "not ok $test_count - $1" shift printf '%s\n' "$*" | sed -e 's/^/# /' test "$immediate" = "" || { finalize_junit_xml; GIT_EXIT_OK=t; exit 1; }