From patchwork Mon Oct 14 12:21:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834875 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B40C07E574 for ; Mon, 14 Oct 2024 12:21:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908478; cv=none; b=gG3NMV/6JH3Ez1V0lAQfkh2n5Wi5fi6OYNJvO2pZ7NMfXf5w0pW/OTOZ2IEo/3Bb995zDeiO8JbrDQg970OGpYyguy89mxXakKSt9PDZKN7HlupkkmuweKPPW9grwvz6KTdmNp1kW44BM/ItLvs8T+kD3SCVKG/bmrDE93ka1N0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908478; c=relaxed/simple; bh=iKmrLQRVVsEhCTsGdrJbpztx+GOdzebsoGOf3FwpsVE=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qit3eR/s9phRVaF8bf2HZnPKKnzv/3LTkDf02pQUG2ufizmezVieRnk8pA1ImyrrbyEPjeHjg20sRPIZ0/CvZcy7bncMCZAsXn+jWU7A1lReF9R9c81O2qoU7opI6f8Z6+QZEeAseIa+lsu2afrHO5X90Wf7gvlWugXBqvoeF6c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=Z90EJERf; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MPh600Y1; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="Z90EJERf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MPh600Y1" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id C548C1380245 for ; Mon, 14 Oct 2024 08:21:15 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 14 Oct 2024 08:21:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908475; x=1728994875; bh=Q4S26CdTUg z6BN257Y5acwJXJifXMrjZ9HYKT7fqt3w=; b=Z90EJERfJv23Fz6oSY3z0QNw19 0zATep82E3+YG9EjQIM9oEhk/yzIewbD026yqOESBmtBk3ZL1rdIa3EWFjMqZzDv kWPUvICwcllgo3PDKXYn/FjY+vresvrHnzbeWfWc1CPLVn+1BRouCXr6yMPrLeSS 2TJBlEimqZVVIp63GaDKybcvFXMQSjIJU9eioHFjbQyxU4kpRmX0LmJAcrSpje93 jK4TXgY22SkeydX9zQQUrN8dgCJiKuuyZrMSYRecDg7sVDIBcAlshmKJEx29MNWR acjZDTMuqxsScy4Ux6idmPlCK097KODYGZtyLH+YD77+Yccg4QDyOMO0H7sw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908475; x=1728994875; bh=Q4S26CdTUgz6BN257Y5acwJXJifX MrjZ9HYKT7fqt3w=; b=MPh600Y1qiwY5hyakes9Jqf1rmTJbxedI77GKloedS56 2IMMiBUnq973KRCQFa4Uv2M2B+TTXv5HXMw+qCj7+f10tAR+WnHGZHn0iUvMmmdB L5/cwMFoMth1Q1RDhXWbT6GusNBR8LEROXF+sSXVF/ZKX0OW9MX7o4M/Im1AVi08 vSXLLRcqWBdvZp6DVbFeiVfATvJvBpoG5XMV2U2nlGePCkV/l1WH8WOXpeEsrtz8 wZuGRUPywexpWlT35TNZXoFS5Ec6rH/9nOdiDxYwGaHhCs5nXHeUfvTu5gUnyEFz LTN1pxnoz40MnXa9dwP6BD5rZHAkqTWyzNpDgiji8w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:15 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 9828dad4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:01 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:12 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE Message-ID: <601670912eeb80cc599c0e7af4ea87c370ae831d.1728906490.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: When assembling our LSAN_OPTIONS that configure the leak sanitizer we end up prepending the string with various different colon-separated options via calls to `prepend_var`. One of the settings we add is the path where the sanitizer should store logs, which can be an arbitrary filesystem path. Naturally, filesystem paths may contain whitespace characters. And while it does seem as if we were quoting the value, we use escaped quotes and consequently split up the value if it does contain spaces. This leads to the following error in t0000 when having a value with whitespaces: .../t/test-lib.sh: eval: line 64: unexpected EOF while looking for matching `"' ++ return 1 error: last command exited with $?=1 not ok 5 - subtest: 3 passing tests The error itself is a bit puzzling at first. The basic problem is that the code sees the leading escaped quote during eval, but because we truncate everything after the space character it doesn't see the trailing escaped quote and thus fails to parse the string. Properly quote the value to fix the issue while using single-quotes to quote the inner value passed to eval. The issue can be reproduced by t0000 with such a path that contains spaces. Signed-off-by: Patrick Steinhardt --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index b1a8ee5c002..241198ba95f 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1572,7 +1572,7 @@ then prepend_var LSAN_OPTIONS : dedup_token_length=9999 prepend_var LSAN_OPTIONS : log_exe_name=1 - prepend_var LSAN_OPTIONS : log_path=\"$TEST_RESULTS_SAN_FILE\" + prepend_var LSAN_OPTIONS : log_path="'$TEST_RESULTS_SAN_FILE'" export LSAN_OPTIONS elif test "$GIT_TEST_PASSING_SANITIZE_LEAK" = "check" || From patchwork Mon Oct 14 12:21:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834876 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9F0B33991 for ; Mon, 14 Oct 2024 12:21:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908482; cv=none; b=nIjlLUrmjYQqL8wttyWOU7C8bRkwcOyLaRBIqTI+1VStN7zbvtdQ73qqaHJTof1AO1lW+TFHZ4Pf1VmR5g95JFAAoMvDzfvHL+e5tCftfiVBcwo2b9ALHWpJjf/qBolfNLOudIYev5UzFTmGsMajLLeaF9Lo/hv1hiUTZeiuWyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908482; c=relaxed/simple; bh=b1vUliGIbJLQmug6NnkOGFL3/59wUdq6tYRVIUKApjI=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K4Pgyv60OartFeCK2Nhlv/lDO1tMLkRyJK8dA9u0OEgdSOjofqfM8acwVjG2pSoe7FfOnc8C3mQCReJaBnAPUJRikg9sf9cXT+CZIeheZLB0ec3YI/n6GqYKwFcit3uQGkBvXH7YGbJwDTa/KRUItbsQn1ZNuWcpesYu34NeyMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=LNHKZusi; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JYr3/BCS; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="LNHKZusi"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JYr3/BCS" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id D756B1380255 for ; Mon, 14 Oct 2024 08:21:18 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Mon, 14 Oct 2024 08:21:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1728908478; x=1728994878; bh=LYUCc/PDVH/MKeobzDgn13xq/BfCEE24jIdHazVRyr4=; b= LNHKZusibBhZd2gwoc1L94iegWQZm6gpTSUOV2nbZXmTJzecMTzLGcoucBbJxjT7 DOFRJ/KpOpRYmoiISq9+PrQgBdeQ0wV723+Ehk/6l8zDFhMeVF8XdQLGSKSpVlu9 dbd0rCyHaAPFxcJUwxdijP1+CnU2UxYBWiaATRPHdbHXT5J7tzmQukuUlZ1GE6oH MnAaHZFqeAwfFLcWNj4UXPjh1LxIxonhWhkrXTt3D1E0E16cVF/vj6qkt/GPWuvA gWcPywocQqzJh91Bsi6wvsxSkxqpC0auaRw/fsKnn0hFNw7iKhT3CkvGaTd57NHX BFsY/z2Cvlc+Xg6FOATeLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1728908478; x= 1728994878; bh=LYUCc/PDVH/MKeobzDgn13xq/BfCEE24jIdHazVRyr4=; b=J Yr3/BCSiiwWMsoU/N3OteidrIB/wXClBhsr1d5OKUTS4C6Vxgxl4mJMY98QToKr8 C96/FufhgXrxUDdoJitlMzhevYcKfV87MPQ1rp37yM9FtM10CcgNWZsDfqbv3mEr 1ORAb9/B6YCYTRkWAdWVSlFdM5lvQic9YTOQ9iWVatg5+ThudGPkHIySmR7ybUrd tV62FOz/NL9lxs/V2i2fhMz303m7ZIhni+u5KM+Tsan0za9N49MUnrSnSJlj+UIh xcZUi03obBUbZ+7SidCc7QkRHbDNEtbWpaaoyuK1I5kbftYMjhD4az+3yVlobjXA H0j/XyipO3p4o7Vtk6jnA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhn hhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrhhnpeeuhffgieegle ekjedtfeegteeugfegveegtdefkeduleeiteevleffuedvleeuieenucffohhmrghinhep hhhtthhpqdhfvghttghhqdguuhhmsgdrshhhnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohep uddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhgvghrrdhkvghrnh gvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:17 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 88f9f103 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:04 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:15 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 02/10] t/test-lib: wire up NO_ICONV prerequisite Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The iconv library is used by Git to reencode files, commit messages and other things. As such it is a rather integral part, but given that many platforms nowadays use UTF-8 everywhere you can live without support for reencoding in many situations. It is thus optional to build Git with iconv, and some of our platforms wired up in "config.mak.uname" disable it. But while we support building without it, running our test suite with "NO_ICONV=Yes" causes many test failures. Wire up a new test prerequisite ICONV that gets populated via our GIT-BUILD-OPTIONS. Annotate failing tests accordingly. Note that this commit does not do a deep dive into every single test to assess whether the failure is expected or not. Most of the tests do smell like the expected kind of failure though. Further note that there are several "!MINGW" conditions in t4201, and all of these fail due to iconv-related errors. This is quite likely a leftover from times before dce7d29551 (msvc: support building Git using MS Visual C++, 2019-06-25), which switched Windows-based builds over from "NO_ICONV=YesPlease" to "NEEDS_LIBICONV=YesPlease". Consequently, adapt those tests to also use the new ICONV prerequisite. Signed-off-by: Patrick Steinhardt --- Makefile | 1 + contrib/buildsystems/CMakeLists.txt | 6 ++ t/t0028-working-tree-encoding.sh | 6 ++ t/t2082-parallel-checkout-attributes.sh | 2 +- t/t3434-rebase-i18n.sh | 6 ++ t/t3900-i18n-commit.sh | 6 ++ t/t3901-i18n-patch.sh | 6 ++ t/t4041-diff-submodule-option.sh | 16 ++- t/t4059-diff-submodule-not-initialized.sh | 16 ++- t/t4060-diff-submodule-option-diff-format.sh | 17 ++-- t/t4201-shortlog.sh | 8 +- t/t4205-log-pretty-formats.sh | 102 +++++++++++-------- t/t4210-log-i18n.sh | 6 ++ t/t4254-am-corrupt.sh | 6 ++ t/t5100-mailinfo.sh | 14 ++- t/t5550-http-fetch-dumb.sh | 4 +- t/t6006-rev-list-format.sh | 54 ++++++---- t/t7102-reset.sh | 40 +++++--- t/t8005-blame-i18n.sh | 6 ++ t/t9300-fast-import.sh | 2 +- t/t9350-fast-export.sh | 10 +- t/test-lib.sh | 1 + 22 files changed, 229 insertions(+), 106 deletions(-) diff --git a/Makefile b/Makefile index feeed6f9321..5db10347341 100644 --- a/Makefile +++ b/Makefile @@ -3171,6 +3171,7 @@ GIT-BUILD-OPTIONS: FORCE @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@+ @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@+ @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@+ + @echo NO_ICONV=\''$(subst ','\'',$(subst ','\'',$(NO_ICONV)))'\' >>$@+ @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@+ @echo USE_LIBPCRE2=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE2)))'\' >>$@+ @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@+ diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 62af7b33d2f..1384c0eb6d3 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -1109,6 +1109,7 @@ set(DIFF diff) set(PYTHON_PATH /usr/bin/python) set(TAR tar) set(NO_CURL ) +set(NO_ICONV ) set(NO_EXPAT ) set(USE_LIBPCRE2 ) set(NO_PERL ) @@ -1122,6 +1123,10 @@ if(NOT CURL_FOUND) set(NO_CURL 1) endif() +if(NOT Iconv_FOUND) + SET(NO_ICONV 1) +endif() + if(NOT EXPAT_FOUND) set(NO_EXPAT 1) endif() @@ -1145,6 +1150,7 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "DIFF='${DIFF}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PYTHON_PATH='${PYTHON_PATH}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "TAR='${TAR}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_CURL='${NO_CURL}'\n") +file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_ICONV='${NO_ICONV}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_EXPAT='${NO_EXPAT}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PERL='${NO_PERL}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PTHREADS='${NO_PTHREADS}'\n") diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index ad151a34670..510da4ca12d 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -12,6 +12,12 @@ TEST_CREATE_REPO_NO_TEMPLATE=1 GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING +if ! test_have_prereq ICONV +then + skip_all='skipping working tree encoding tests; iconv not available' + test_done +fi + test_expect_success 'setup test files' ' git config core.eol lf && diff --git a/t/t2082-parallel-checkout-attributes.sh b/t/t2082-parallel-checkout-attributes.sh index aec55496eb1..a040aa54cee 100755 --- a/t/t2082-parallel-checkout-attributes.sh +++ b/t/t2082-parallel-checkout-attributes.sh @@ -34,7 +34,7 @@ test_expect_success 'parallel-checkout with ident' ' ) ' -test_expect_success 'parallel-checkout with re-encoding' ' +test_expect_success ICONV 'parallel-checkout with re-encoding' ' set_checkout_config 2 0 && git init encoding && ( diff --git a/t/t3434-rebase-i18n.sh b/t/t3434-rebase-i18n.sh index 26a48d6b103..97fc9a23f21 100755 --- a/t/t3434-rebase-i18n.sh +++ b/t/t3434-rebase-i18n.sh @@ -20,6 +20,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if ! test_have_prereq ICONV +then + skip_all='skipping rebase i18n tests; iconv not available' + test_done +fi + compare_msg () { iconv -f "$2" -t "$3" "$TEST_DIRECTORY/t3434/$1" >expect && git cat-file commit HEAD >raw && diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh index db7b403bc15..9d4b5ab1f95 100755 --- a/t/t3900-i18n-commit.sh +++ b/t/t3900-i18n-commit.sh @@ -8,6 +8,12 @@ test_description='commit and log output encodings' TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if ! test_have_prereq ICONV +then + skip_all='skipping commit i18n tests; iconv not available' + test_done +fi + compare_with () { git show -s $1 | sed -e '1,/^$/d' -e 's/^ //' >current && case "$3" in diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index 5f0b9afc3fa..e0659c92935 100755 --- a/t/t3901-i18n-patch.sh +++ b/t/t3901-i18n-patch.sh @@ -11,6 +11,12 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if ! test_have_prereq ICONV +then + skip_all='skipping patch i18n tests; iconv not available' + test_done +fi + check_encoding () { # Make sure characters are not corrupted cnt="$1" header="$2" i=1 j=0 diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index 8fc40e75eb3..aa149e0085e 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -15,12 +15,18 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh -# Tested non-UTF-8 encoding -test_encoding="ISO8859-1" +# Test non-UTF-8 encoding in case iconv is available. +if test_have_prereq ICONV +then + test_encoding="ISO8859-1" + # String "added" in German (translated with Google Translate), encoded in UTF-8, + # used in sample commit log messages in add_file() function below. + added=$(printf "hinzugef\303\274gt") +else + test_encoding="UTF-8" + added="added" +fi -# String "added" in German (translated with Google Translate), encoded in UTF-8, -# used in sample commit log messages in add_file() function below. -added=$(printf "hinzugef\303\274gt") add_file () { ( cd "$1" && diff --git a/t/t4059-diff-submodule-not-initialized.sh b/t/t4059-diff-submodule-not-initialized.sh index 668f5263038..28fd3cdb154 100755 --- a/t/t4059-diff-submodule-not-initialized.sh +++ b/t/t4059-diff-submodule-not-initialized.sh @@ -12,12 +12,18 @@ initialized previously but the checkout has since been removed. TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh -# Tested non-UTF-8 encoding -test_encoding="ISO8859-1" -# String "added" in German (translated with Google Translate), encoded in UTF-8, -# used in sample commit log messages in add_file() function below. -added=$(printf "hinzugef\303\274gt") +# Test non-UTF-8 encoding in case iconv is available. +if test_have_prereq ICONV +then + test_encoding="ISO8859-1" + # String "added" in German (translated with Google Translate), encoded in UTF-8, + # used in sample commit log messages in add_file() function below. + added=$(printf "hinzugef\303\274gt") +else + test_encoding="UTF-8" + added="added" +fi add_file () { ( diff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh index 8ce67442d96..918334fa4c8 100755 --- a/t/t4060-diff-submodule-option-diff-format.sh +++ b/t/t4060-diff-submodule-option-diff-format.sh @@ -13,12 +13,17 @@ This test tries to verify the sanity of --submodule=diff option of git diff. TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh -# Tested non-UTF-8 encoding -test_encoding="ISO8859-1" - -# String "added" in German (translated with Google Translate), encoded in UTF-8, -# used in sample commit log messages in add_file() function below. -added=$(printf "hinzugef\303\274gt") +# Test non-UTF-8 encoding in case iconv is available. +if test_have_prereq ICONV +then + test_encoding="ISO8859-1" + # String "added" in German (translated with Google Translate), encoded in UTF-8, + # used in sample commit log messages in add_file() function below. + added=$(printf "hinzugef\303\274gt") +else + test_encoding="UTF-8" + added="added" +fi add_file () { ( diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh index c20c8857244..680e707ba1e 100755 --- a/t/t4201-shortlog.sh +++ b/t/t4201-shortlog.sh @@ -105,7 +105,7 @@ test_expect_success 'output from user-defined format is re-wrapped' ' test_cmp expect log.predictable ' -test_expect_success !MINGW 'shortlog wrapping' ' +test_expect_success ICONV 'shortlog wrapping' ' cat >expect <<\EOF && A U Thor (5): Test @@ -126,13 +126,13 @@ EOF test_cmp expect out ' -test_expect_success !MINGW 'shortlog from non-git directory' ' +test_expect_success ICONV 'shortlog from non-git directory' ' git log --no-expand-tabs HEAD >log && GIT_DIR=non-existing git shortlog -w out && test_cmp expect out ' -test_expect_success !MINGW 'shortlog can read --format=raw output' ' +test_expect_success ICONV 'shortlog can read --format=raw output' ' git log --format=raw HEAD >log && GIT_DIR=non-existing git shortlog -w out && test_cmp expect out @@ -182,7 +182,7 @@ $DSCHO (2): EOF -test_expect_success !MINGW 'shortlog encoding' ' +test_expect_success ICONV 'shortlog encoding' ' git reset --hard "$commit" && git config --unset i18n.commitencoding && echo 2 > a1 && diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh index eb63ce011fa..dbbd6125510 100755 --- a/t/t4205-log-pretty-formats.sh +++ b/t/t4205-log-pretty-formats.sh @@ -114,19 +114,19 @@ test_expect_success 'alias loop' ' test_must_fail git log --pretty=test-foo ' -test_expect_success 'NUL separation' ' +test_expect_success ICONV 'NUL separation' ' printf "add bar\0$(commit_msg)" >expected && git log -z --pretty="format:%s" >actual && test_cmp expected actual ' -test_expect_success 'NUL termination' ' +test_expect_success ICONV 'NUL termination' ' printf "add bar\0$(commit_msg)\0" >expected && git log -z --pretty="tformat:%s" >actual && test_cmp expected actual ' -test_expect_success 'NUL separation with --stat' ' +test_expect_success ICONV 'NUL separation with --stat' ' stat0_part=$(git diff --stat HEAD^ HEAD) && stat1_part=$(git diff-tree --no-commit-id --stat --root HEAD^) && printf "add bar\n$stat0_part\n\0$(commit_msg)\n$stat1_part\n" >expected && @@ -181,7 +181,7 @@ test_expect_success 'setup more commits' ' head4=$(git rev-parse --verify --short HEAD~3) ' -test_expect_success 'left alignment formatting' ' +test_expect_success ICONV 'left alignment formatting' ' git log --pretty="tformat:%<(40)%s" >actual && qz_to_tab_space <<-EOF >expected && message two Z @@ -192,7 +192,7 @@ test_expect_success 'left alignment formatting' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting. i18n.logOutputEncoding' ' +test_expect_success ICONV 'left alignment formatting. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(40)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && message two Z @@ -203,7 +203,7 @@ test_expect_success 'left alignment formatting. i18n.logOutputEncoding' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting at the nth column' ' +test_expect_success ICONV 'left alignment formatting at the nth column' ' git log --pretty="tformat:%h %<|(40)%s" >actual && qz_to_tab_space <<-EOF >expected && $head1 message two Z @@ -214,7 +214,7 @@ test_expect_success 'left alignment formatting at the nth column' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting at the nth column' ' +test_expect_success ICONV 'left alignment formatting at the nth column' ' COLUMNS=50 git log --pretty="tformat:%h %<|(-10)%s" >actual && qz_to_tab_space <<-EOF >expected && $head1 message two Z @@ -225,7 +225,7 @@ test_expect_success 'left alignment formatting at the nth column' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting at the nth column. i18n.logOutputEncoding' ' +test_expect_success ICONV 'left alignment formatting at the nth column. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %<|(40)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && $head1 message two Z @@ -236,7 +236,7 @@ test_expect_success 'left alignment formatting at the nth column. i18n.logOutput test_cmp expected actual ' -test_expect_success 'left alignment formatting with no padding' ' +test_expect_success ICONV 'left alignment formatting with no padding' ' git log --pretty="tformat:%<(1)%s" >actual && cat <<-EOF >expected && message two @@ -258,7 +258,7 @@ test_expect_success 'left alignment formatting with no padding. i18n.logOutputEn test_cmp expected actual ' -test_expect_success 'left alignment formatting with trunc' ' +test_expect_success ICONV 'left alignment formatting with trunc' ' git log --pretty="tformat:%<(10,trunc)%s" >actual && qz_to_tab_space <<-\EOF >expected && message .. @@ -269,7 +269,7 @@ test_expect_success 'left alignment formatting with trunc' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncoding' ' +test_expect_success ICONV 'left alignment formatting with trunc. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s" >actual && qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && message .. @@ -280,7 +280,7 @@ test_expect_success 'left alignment formatting with trunc. i18n.logOutputEncodin test_cmp expected actual ' -test_expect_success 'left alignment formatting with ltrunc' ' +test_expect_success ICONV 'left alignment formatting with ltrunc' ' git log --pretty="tformat:%<(10,ltrunc)%s" >actual && qz_to_tab_space <<-EOF >expected && ..sage two @@ -291,7 +291,7 @@ test_expect_success 'left alignment formatting with ltrunc' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncoding' ' +test_expect_success ICONV 'left alignment formatting with ltrunc. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,ltrunc)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && ..sage two @@ -302,7 +302,7 @@ test_expect_success 'left alignment formatting with ltrunc. i18n.logOutputEncodi test_cmp expected actual ' -test_expect_success 'left alignment formatting with mtrunc' ' +test_expect_success ICONV 'left alignment formatting with mtrunc' ' git log --pretty="tformat:%<(10,mtrunc)%s" >actual && qz_to_tab_space <<-\EOF >expected && mess.. two @@ -313,7 +313,7 @@ test_expect_success 'left alignment formatting with mtrunc' ' test_cmp expected actual ' -test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncoding' ' +test_expect_success ICONV 'left alignment formatting with mtrunc. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,mtrunc)%s" >actual && qz_to_tab_space <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && mess.. two @@ -324,7 +324,7 @@ test_expect_success 'left alignment formatting with mtrunc. i18n.logOutputEncodi test_cmp expected actual ' -test_expect_success 'right alignment formatting' ' +test_expect_success ICONV 'right alignment formatting' ' git log --pretty="tformat:%>(40)%s" >actual && qz_to_tab_space <<-EOF >expected && Z message two @@ -335,7 +335,7 @@ test_expect_success 'right alignment formatting' ' test_cmp expected actual ' -test_expect_success 'right alignment formatting. i18n.logOutputEncoding' ' +test_expect_success ICONV 'right alignment formatting. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(40)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && Z message two @@ -346,7 +346,7 @@ test_expect_success 'right alignment formatting. i18n.logOutputEncoding' ' test_cmp expected actual ' -test_expect_success 'right alignment formatting at the nth column' ' +test_expect_success ICONV 'right alignment formatting at the nth column' ' git log --pretty="tformat:%h %>|(40)%s" >actual && qz_to_tab_space <<-EOF >expected && $head1 message two @@ -357,7 +357,7 @@ test_expect_success 'right alignment formatting at the nth column' ' test_cmp expected actual ' -test_expect_success 'right alignment formatting at the nth column' ' +test_expect_success ICONV 'right alignment formatting at the nth column' ' COLUMNS=50 git log --pretty="tformat:%h %>|(-10)%s" >actual && qz_to_tab_space <<-EOF >expected && $head1 message two @@ -368,7 +368,7 @@ test_expect_success 'right alignment formatting at the nth column' ' test_cmp expected actual ' -test_expect_success 'right alignment formatting at the nth column. i18n.logOutputEncoding' ' +test_expect_success ICONV 'right alignment formatting at the nth column. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %>|(40)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && $head1 message two @@ -381,7 +381,7 @@ test_expect_success 'right alignment formatting at the nth column. i18n.logOutpu # Note: Space between 'message' and 'two' should be in the same column # as in previous test. -test_expect_success 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' ' +test_expect_success ICONV 'right alignment formatting at the nth column with --graph. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --graph --pretty="tformat:%h %>|(40)%s" >actual && iconv -f utf-8 -t $test_encoding >expected <<-EOF && * $head1 message two @@ -392,7 +392,7 @@ test_expect_success 'right alignment formatting at the nth column with --graph. test_cmp expected actual ' -test_expect_success 'right alignment formatting with no padding' ' +test_expect_success ICONV 'right alignment formatting with no padding' ' git log --pretty="tformat:%>(1)%s" >actual && cat <<-EOF >expected && message two @@ -403,7 +403,7 @@ test_expect_success 'right alignment formatting with no padding' ' test_cmp expected actual ' -test_expect_success 'right alignment formatting with no padding and with --graph' ' +test_expect_success ICONV 'right alignment formatting with no padding and with --graph' ' git log --graph --pretty="tformat:%>(1)%s" >actual && cat <<-EOF >expected && * message two @@ -414,7 +414,7 @@ test_expect_success 'right alignment formatting with no padding and with --graph test_cmp expected actual ' -test_expect_success 'right alignment formatting with no padding. i18n.logOutputEncoding' ' +test_expect_success ICONV 'right alignment formatting with no padding. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%>(1)%s" >actual && cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected && message two @@ -425,7 +425,7 @@ test_expect_success 'right alignment formatting with no padding. i18n.logOutputE test_cmp expected actual ' -test_expect_success 'center alignment formatting' ' +test_expect_success ICONV 'center alignment formatting' ' git log --pretty="tformat:%><(40)%s" >actual && qz_to_tab_space <<-EOF >expected && Z message two Z @@ -436,7 +436,7 @@ test_expect_success 'center alignment formatting' ' test_cmp expected actual ' -test_expect_success 'center alignment formatting. i18n.logOutputEncoding' ' +test_expect_success ICONV 'center alignment formatting. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(40)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && Z message two Z @@ -446,7 +446,7 @@ test_expect_success 'center alignment formatting. i18n.logOutputEncoding' ' EOF test_cmp expected actual ' -test_expect_success 'center alignment formatting at the nth column' ' +test_expect_success ICONV 'center alignment formatting at the nth column' ' git log --pretty="tformat:%h %><|(40)%s" >actual && qz_to_tab_space <<-EOF >expected && $head1 message two Z @@ -457,7 +457,7 @@ test_expect_success 'center alignment formatting at the nth column' ' test_cmp expected actual ' -test_expect_success 'center alignment formatting at the nth column' ' +test_expect_success ICONV 'center alignment formatting at the nth column' ' COLUMNS=70 git log --pretty="tformat:%h %><|(-30)%s" >actual && qz_to_tab_space <<-EOF >expected && $head1 message two Z @@ -468,7 +468,7 @@ test_expect_success 'center alignment formatting at the nth column' ' test_cmp expected actual ' -test_expect_success 'center alignment formatting at the nth column. i18n.logOutputEncoding' ' +test_expect_success ICONV 'center alignment formatting at the nth column. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%h %><|(40)%s" >actual && qz_to_tab_space <<-EOF | iconv -f utf-8 -t $test_encoding >expected && $head1 message two Z @@ -479,7 +479,7 @@ test_expect_success 'center alignment formatting at the nth column. i18n.logOutp test_cmp expected actual ' -test_expect_success 'center alignment formatting with no padding' ' +test_expect_success ICONV 'center alignment formatting with no padding' ' git log --pretty="tformat:%><(1)%s" >actual && cat <<-EOF >expected && message two @@ -493,7 +493,7 @@ test_expect_success 'center alignment formatting with no padding' ' # save HEAD's SHA-1 digest (with no abbreviations) to use it below # as far as the next test amends HEAD old_head1=$(git rev-parse --verify HEAD~0) -test_expect_success 'center alignment formatting with no padding. i18n.logOutputEncoding' ' +test_expect_success ICONV 'center alignment formatting with no padding. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%><(1)%s" >actual && cat <<-EOF | iconv -f utf-8 -t $test_encoding >expected && message two @@ -504,7 +504,7 @@ test_expect_success 'center alignment formatting with no padding. i18n.logOutput test_cmp expected actual ' -test_expect_success 'left/right alignment formatting with stealing' ' +test_expect_success ICONV 'left/right alignment formatting with stealing' ' git commit --amend -m short --author "long long long " && git log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual && cat <<-\EOF >expected && @@ -515,7 +515,7 @@ test_expect_success 'left/right alignment formatting with stealing' ' EOF test_cmp expected actual ' -test_expect_success 'left/right alignment formatting with stealing. i18n.logOutputEncoding' ' +test_expect_success ICONV 'left/right alignment formatting with stealing. i18n.logOutputEncoding' ' git -c i18n.logOutputEncoding=$test_encoding log --pretty="tformat:%<(10,trunc)%s%>>(10,ltrunc)% an" >actual && cat <<-\EOF | iconv -f utf-8 -t $test_encoding >expected && short long long long @@ -564,22 +564,38 @@ test_expect_success 'log decoration properly follows tag chain' ' git tag -d tag1 && git commit --amend -m shorter && git log --no-walk --tags --pretty="%H %d" --decorate=full >actual && - cat <<-EOF >expected && - $head2 (tag: refs/tags/message-one) - $old_head1 (tag: refs/tags/message-two) - $head1 (tag: refs/tags/tag2) - EOF + if test_have_prereq ICONV + then + cat <<-EOF >expected + $head2 (tag: refs/tags/message-one) + $old_head1 (tag: refs/tags/message-two) + $head1 (tag: refs/tags/tag2) + EOF + else + cat <<-EOF >expected + $head2 (tag: refs/tags/message-one) + $old_head1 (tag: refs/tags/tag2, tag: refs/tags/message-two) + EOF + fi && sort -k3 actual >actual1 && test_cmp expected actual1 ' test_expect_success 'clean log decoration' ' git log --no-walk --tags --pretty="%H %D" --decorate=full >actual && - cat >expected <<-EOF && - $head2 tag: refs/tags/message-one - $old_head1 tag: refs/tags/message-two - $head1 tag: refs/tags/tag2 - EOF + if test_have_prereq ICONV + then + cat <<-EOF >expected + $head2 tag: refs/tags/message-one + $old_head1 tag: refs/tags/message-two + $head1 tag: refs/tags/tag2 + EOF + else + cat <<-EOF >expected + $head2 tag: refs/tags/message-one + $old_head1 tag: refs/tags/tag2, tag: refs/tags/message-two + EOF + fi && sort -k3 actual >actual1 && test_cmp expected actual1 ' diff --git a/t/t4210-log-i18n.sh b/t/t4210-log-i18n.sh index 7120030b5c6..4a12b2b4979 100755 --- a/t/t4210-log-i18n.sh +++ b/t/t4210-log-i18n.sh @@ -5,6 +5,12 @@ test_description='test log with i18n features' TEST_PASSES_SANITIZE_LEAK=true . ./lib-gettext.sh +if ! test_have_prereq ICONV +then + skip_all='skipping log i18n tests; iconv not available' + test_done +fi + # two forms of é utf8_e=$(printf '\303\251') latin1_e=$(printf '\351') diff --git a/t/t4254-am-corrupt.sh b/t/t4254-am-corrupt.sh index 661feb60709..cb03522d021 100755 --- a/t/t4254-am-corrupt.sh +++ b/t/t4254-am-corrupt.sh @@ -5,6 +5,12 @@ test_description='git am with corrupt input' TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh +if ! test_have_prereq ICONV +then + skip_all='skipping am encoding corruption tests; iconv not available' + test_done +fi + make_mbox_with_nul () { space=' ' q_nul_in_subject= diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh index 065156c1f39..23b2f218725 100755 --- a/t/t5100-mailinfo.sh +++ b/t/t5100-mailinfo.sh @@ -28,7 +28,12 @@ check_mailinfo () { for mail in 00* do - test_expect_success "mailinfo $mail" ' + case "$mail" in + 0004) + prereq=ICONV;; + esac + + test_expect_success $prereq "mailinfo $mail" ' check_mailinfo "$mail" "" && if test -f "$DATA/msg$mail--scissors" then @@ -56,7 +61,12 @@ test_expect_success 'split box with rfc2047 samples' \ for mail in rfc2047/00* do - test_expect_success "mailinfo $mail" ' + case "$mail" in + rfc2047/0001) + prereq=ICONV;; + esac + + test_expect_success $prereq "mailinfo $mail" ' git mailinfo -u "$mail-msg" "$mail-patch" <"$mail" >"$mail-info" && echo msg && test_cmp "$DATA/empty" "$mail-msg" && diff --git a/t/t5550-http-fetch-dumb.sh b/t/t5550-http-fetch-dumb.sh index 58189c9f7dc..3c873de17ec 100755 --- a/t/t5550-http-fetch-dumb.sh +++ b/t/t5550-http-fetch-dumb.sh @@ -344,12 +344,12 @@ test_expect_success 'git client shows text/plain with a charset' ' grep "this is the error message" stderr ' -test_expect_success 'http error messages are reencoded' ' +test_expect_success ICONV 'http error messages are reencoded' ' test_must_fail git clone "$HTTPD_URL/error/utf16" 2>stderr && grep "this is the error message" stderr ' -test_expect_success 'reencoding is robust to whitespace oddities' ' +test_expect_success ICONV 'reencoding is robust to whitespace oddities' ' test_must_fail git clone "$HTTPD_URL/error/odd-spacing" 2>stderr && grep "this is the error message" stderr ' diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index f1623b1c06d..2a01a62a2f3 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -13,21 +13,41 @@ TEST_PASSES_SANITIZE_LEAK=true . "$TEST_DIRECTORY"/lib-terminal.sh test_tick -# Tested non-UTF-8 encoding -test_encoding="ISO8859-1" - -# String "added" in German -# (translated with Google Translate), -# encoded in UTF-8, used as a commit log message below. -added_utf8_part=$(printf "\303\274") -added_utf8_part_iso88591=$(echo "$added_utf8_part" | iconv -f utf-8 -t $test_encoding) -added=$(printf "added (hinzugef${added_utf8_part}gt) foo") -added_iso88591=$(echo "$added" | iconv -f utf-8 -t $test_encoding) -# same but "changed" -changed_utf8_part=$(printf "\303\244") -changed_utf8_part_iso88591=$(echo "$changed_utf8_part" | iconv -f utf-8 -t $test_encoding) -changed=$(printf "changed (ge${changed_utf8_part}ndert) foo") -changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding) + +if test_have_prereq ICONV +then + # Tested non-UTF-8 encoding + test_encoding="ISO8859-1" + + # String "added" in German + # (translated with Google Translate), + # encoded in UTF-8, used as a commit log message below. + added_utf8_part=$(printf "\303\274") + added_utf8_part_iso88591=$(echo "$added_utf8_part" | iconv -f utf-8 -t $test_encoding) + added=$(printf "added (hinzugef${added_utf8_part}gt) foo") + added_iso88591=$(echo "$added" | iconv -f utf-8 -t $test_encoding) + # same but "changed" + changed_utf8_part=$(printf "\303\244") + changed_utf8_part_iso88591=$(echo "$changed_utf8_part" | iconv -f utf-8 -t $test_encoding) + changed=$(printf "changed (ge${changed_utf8_part}ndert) foo") + changed_iso88591=$(echo "$changed" | iconv -f utf-8 -t $test_encoding) +else + # Tested non-UTF-8 encoding + test_encoding="UTF-8" + + # String "added" in German + # (translated with Google Translate), + # encoded in UTF-8, used as a commit log message below. + added_utf8_part="u" + added_utf8_part_iso88591="u" + added=$(printf "added (hinzugef${added_utf8_part}gt) foo") + added_iso88591="$added" + # same but "changed" + changed_utf8_part="a" + changed_utf8_part_iso88591="a" + changed=$(printf "changed (ge${changed_utf8_part}ndert) foo") + changed_iso88591="$changed" +fi # Count of char to truncate # Number is chosen so, that non-ACSII characters @@ -198,7 +218,7 @@ Thu, 7 Apr 2005 15:13:13 -0700 1112911993 EOF -test_format encoding %e <input <<-INPUT_END && commit refs/heads/encoding diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 2bdc02b4599..9595dfef2ee 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -125,7 +125,7 @@ test_expect_success 'fast-export --show-original-ids | git fast-import' ' test $MUSS = $(git rev-parse --verify refs/tags/muss) ' -test_expect_success 'reencoding iso-8859-7' ' +test_expect_success ICONV 'reencoding iso-8859-7' ' test_when_finished "git reset --hard HEAD~1" && test_config i18n.commitencoding iso-8859-7 && @@ -421,7 +421,7 @@ M 100644 :1 there EOF -test_expect_success 'dropping tag of filtered out object' ' +test_expect_success ICONV 'dropping tag of filtered out object' ' ( cd limit-by-paths && git fast-export --tag-of-filtered-object=drop mytag -- there > output && @@ -438,7 +438,7 @@ msg EOF -test_expect_success 'rewriting tag of filtered out object' ' +test_expect_success ICONV 'rewriting tag of filtered out object' ' ( cd limit-by-paths && git fast-export --tag-of-filtered-object=rewrite mytag -- there > output && @@ -667,7 +667,7 @@ M 100644 :13 file EOF -test_expect_success 'avoid uninteresting refs' ' +test_expect_success ICONV 'avoid uninteresting refs' ' > tmp-marks && git fast-export --import-marks=tmp-marks \ --export-marks=tmp-marks main > /dev/null && @@ -686,7 +686,7 @@ from :14 EOF -test_expect_success 'refs are updated even if no commits need to be exported' ' +test_expect_success ICONV 'refs are updated even if no commits need to be exported' ' > tmp-marks && git fast-export --import-marks=tmp-marks \ --export-marks=tmp-marks main > /dev/null && diff --git a/t/test-lib.sh b/t/test-lib.sh index 241198ba95f..a278181a056 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1743,6 +1743,7 @@ esac ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1 test -z "$NO_CURL" && test_set_prereq LIBCURL +test -z "$NO_ICONV" && test_set_prereq ICONV test -z "$NO_PERL" && test_set_prereq PERL test -z "$NO_PTHREADS" && test_set_prereq PTHREADS test -z "$NO_PYTHON" && test_set_prereq PYTHON From patchwork Mon Oct 14 12:21:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834877 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6DFC7E574 for ; Mon, 14 Oct 2024 12:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908483; cv=none; b=G37CDqyj7JkcHG6Ey+3Pho9+9iw92vvPubaAjvsfVj8HaZhyb7I6G0MqsN4z5ExXKbtM5d7sLJuTa7+RypwkNqIXGJNMw96ar394a0X3hox/Y2baFelkTD9qhG50IaT1Yz9aZ/1Qtt5cCn9clDB4CiFW5JNRi0POKYt2dqUEN1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908483; c=relaxed/simple; bh=Ou5SFhL/rUe6C+qwfh4+iFosi78FuFspGv3OQKjbP+4=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Qrms3xBSvOH/4XLE7bArshfJhOgZkgL5bvHkvzzLEHU1PD2QSd6UEdTCYbgfNmf1Ii2ighBXzeZZHgFeqK2UFE1ldqsMMIJ87AhPJKxrOYZNamTFH8KBjzeyzR0kANb/XBzd+7kqK55Bzq3X7qFr5gKd3w+kZy4tg9QCPWcuajE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=sKztrLbS; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=b71SxOfP; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="sKztrLbS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="b71SxOfP" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id CAB71138023C for ; Mon, 14 Oct 2024 08:21:20 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 14 Oct 2024 08:21:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908480; x=1728994880; bh=L/smTfNcha Y++CwGOKTQVb6OTjgn3o8COvfEr0IVfIY=; b=sKztrLbScCE8RdAfTCb/qmSl7q 4iQ+iP9JMWfMeaGKil5fTu8bs6Toc93kMMLHDusik3Bqg0WXDRPWpCYQhkk2qRXp 29vsTNeNAYxUBXP2HMtSDOD0kCy495xKoRWRtZKnmdWXThVXBraZp/pbDyMnxTIz zwzJds6hJoM90UHAs/FogrAAJwjtjMvfvsytW3xl69C/oY6LmwJSGWMhgAPZg3T5 HB5XjMRAATSNp1+useOIoyqk6b/jNgFz0KtX8174tk5AWadB196dd7OoIeAju4WK FzWJV04I0t1wuL7nzBUi7CcrBUYATrA1Nny5LALs8AWgu918odimu9ylp/9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908480; x=1728994880; bh=L/smTfNchaY++CwGOKTQVb6OTjgn 3o8COvfEr0IVfIY=; b=b71SxOfPuXpYM3HD1Pwzoto1ZyqqiqaXeD8tOb2m/Aqz qdCbvv91FxeANWg1XJHDkJAX5Q+JirzEBrkawUfoPvcIh2LZFYrwUIETnKbhDKxC jZOn2Uic5jvki3OQpf05iqMVSH/8DYKuS1Ar4tvKWjoIwPCaJ0iAlvmpiUHsm5JL YKikBpFhOSxSz5MvRl1pOFet/i+0MoeOD2Srkasa/+S5gECnUxLxdQEfA/fYjxIk EsGb6wdMhBzMX9V5CPb4YI8LvJI3J/XbWXQSXzMdJd1RnBuk2fqSIzNEZ+d6SX3s G3uxxBaZvHe00BKAnYYYAsm7Wn9yWhai2Arro6UEZw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:20 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id fbf20133 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:07 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:18 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 03/10] t/lib-gitweb: test against the build version of gitweb Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: When testing gitweb we set up the CGI script as "gitweb.perl", which is the source file of the build target "gitweb.cgi". This works alright as long as we run in-tree tests. But we're about to make out-of-tree tests a reality, and there things will break because "gitweb.perl" will not be found in the build directory. Fix this by using "gitweb.cgi" instead. Signed-off-by: Patrick Steinhardt --- t/lib-gitweb.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh index 1f32ca66ea5..c64c87fb87d 100644 --- a/t/lib-gitweb.sh +++ b/t/lib-gitweb.sh @@ -49,7 +49,7 @@ EOF error "Cannot find gitweb at $GITWEB_TEST_INSTALLED." say "# Testing $SCRIPT_NAME" else # normal case, use source version of gitweb - SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.perl" + SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.cgi" fi export SCRIPT_NAME } From patchwork Mon Oct 14 12:21:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834878 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C95B1A4F04 for ; Mon, 14 Oct 2024 12:21:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908486; cv=none; b=Qa3ay35MVH2hwJ/GNm+T0cBl0Y3urB7c0fNc3X1/Apa3aQ/t+IDBO255P3ljEIGn4q0FQvsDGqVRHySkz8QyafQGYgZk2QY6T58DHvGCigOvjBGSdTPGOqHd1w0b1PyftBX2BLjLll8YEjkWIXXpMuv8vKb8f5Jk7Cp1e93PM1I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908486; c=relaxed/simple; bh=OVeKR2gKotxaTVfUDznfksjbL1OH385CTjK0c8fBtjU=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WTMjjZRryBB5/zypm72QAh8LGavOnL/IMqSyMaCk1IiyfwPQ++RpX/odmgzRsaX/3eIKKZba6Eka7n2wCsHXnVBkF5acAtFmy/jPniBPFWEytSPAMI4pZXIuTak8v/IcrL9zerw97TuyRRt0dMliQ04y6nycxrizT8ydJgkz8yc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=ogQeLt4/; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=CGNeyf+S; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="ogQeLt4/"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CGNeyf+S" Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id A630711401ED for ; Mon, 14 Oct 2024 08:21:23 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 14 Oct 2024 08:21:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908483; x=1728994883; bh=fDY6ebe/3R mX5qqZk8gsyQSz4XZDyjR59e0bMG1cbxo=; b=ogQeLt4/oivcFjbienAYPMb5HT UMyr4Nam2f/xOULJGsPfCeo/an2IYSM0F0vAL1bvKqE2EmdetsubwrcJeUxQv6VZ r6iB77TY/eWMzW7EkbcmKeKUJVSrR1i3Mf7PY0aGVyhVhVRMj9rW6Hy2/2JXb1JU Dfbg4QmN3dlyomZMKoceqNIe7oAy68v5JKrtK8u+0jB3SyUBB6VJcftrh1BzhHje sI5Kix//OyIOmeTYgwYmEmhy2SxZAxNThM2sV+kxjhADVDX7v31bklwTGachI4W+ ts0whr9a8ScWkIpY3AxmKUsboTTNkPMPk2XaFA6avBjqEbiwQxKQy8Wxw5lA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908483; x=1728994883; bh=fDY6ebe/3RmX5qqZk8gsyQSz4XZD yjR59e0bMG1cbxo=; b=CGNeyf+SDryGxb+ky1eiDbx6MdiiCTHejMvMT0Gdyf+f NehaaE6gC98ofZO//Mo2NiJwNVpSaRbr4Ai5aiOnOhDlfiYFXIKZJBc7lJkpNTkd GJmHRu+YnAOcpaJUbqi917cI67iq8GURuqyaMchuZV8C97JRmfMf3hIbtA5bi5nw lAfeiWuwfUA2m8qfeWgUFA7vLrrCiqaN/xvaeXM4e+04GBAoicpWY6v70NuzavBW BCOkmz28dlDoTRjNju1iP72QrDE0hyDwouElMblmF08vcZig/R5DH493UKtJYnk2 7uJeLI1zS+lkP0qljc4HHzvBNdj4Z0tB4QczoAZr5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:22 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id ff503fd7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:09 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:20 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: In "t/lib-gpg.sh" we set up the "GNUPGHOME" environment variable to point to a test-specific directory. This is done by using "$PWD/gpghome" as value, where "$PWD" is the current test's trash directory. This is broken for MinGW though because "$PWD" will use Windows-style paths that contain drive letters. What we really want in this context is a Unix-style path, which we can get by using `$(pwd)` instead. It is somewhat puzzling that nobody ever hit this issue, but it may easily be that nobody ever tests on Windows with GnuPG installed, which would make us skip those tests. Adapt the code accordingly to fix tests using this library. Signed-off-by: Patrick Steinhardt --- t/lib-gpg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/lib-gpg.sh b/t/lib-gpg.sh index add11e88fc0..3845b6ac449 100644 --- a/t/lib-gpg.sh +++ b/t/lib-gpg.sh @@ -6,7 +6,7 @@ # executed in an eval'ed subshell that changes the working directory to a # temporary one. -GNUPGHOME="$PWD/gpghome" +GNUPGHOME="$(pwd)/gpghome" export GNUPGHOME test_lazy_prereq GPG ' From patchwork Mon Oct 14 12:21:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834879 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 633F31A2875 for ; Mon, 14 Oct 2024 12:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908490; cv=none; b=OwXko0m2kBBXjPfp62hLGUyHEtkhow9jIhJdiAfyaoayNoHENLB64DY1sN+GA5FmAq2STfB/FJy8zZtzcgM4r7ouhsBcxoAk0r6VSVzFHUe1AzoBaOkkH63EqI0M7ijsAKVn4Jv1krmFU3eNyoYkqQFVCrG4lP8juGO1P1iTY9E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908490; c=relaxed/simple; bh=RtPCJt6jP1jVfoOSn9WB6ielj2PwfYTPLarQuPNy/no=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Fm51Zum1iUV32eheGlWKyVF2dBKULCuRDS9apOqXe59FxlcPq0VfzM+ojvdlrKR6Sv6A0H6XJvK5kbX1Y2+9e3YYR+3T7OYYnKo98pX9koWQ+pwN/6f7BP/kaUvHVMNpbDa1nhsfLDPjolOXM9dF04Y/qQnVaQcgHHmLzEFaWUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=nA5oExh8; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=lDEh5v5W; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="nA5oExh8"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="lDEh5v5W" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id 846391380256 for ; Mon, 14 Oct 2024 08:21:28 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Mon, 14 Oct 2024 08:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908488; x=1728994888; bh=jrt8NDJO47 rPxAsOoF3z6yr03MRBQBEoIbTN4/hhDso=; b=nA5oExh8DhvkFBflfrJ+DpXxPg gga9XRr/cq0/ulOi8wQbG55LnbG8GnNBCljJ7Ovyr47NX6LFmVynozf5NdJJ2npS 19odrmyfxX16rmFG+6xvoGqP6csc5oABsfin78KmdvrFGmClHgqKEkV6KSYhzfJo kmnSZEmMjeHaCfuIpQP0v320vlPOxvxjwf3h9iqXibNbvYd/9AT72hxDrhHPqhaJ RjG4RQkNniyvWgYN8nF15zyQ2QSKlmNdZj4poQBwoL+HeidAk2lNvXN9fYrMthoD VBEu1H6HYKQEnPweHC0BPGvMNYZdt5+gOyegeXsFgKfWy41gzxPzr9myc1gA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908488; x=1728994888; bh=jrt8NDJO47rPxAsOoF3z6yr03MRB QBEoIbTN4/hhDso=; b=lDEh5v5WAvPbmlL4G/M1azd8XRwcpLaMAe97YI7/DrM3 HoVMgv8p6VQc2kvqZx006h2gJBxz/mqr/0CXtvGiLQWEggKs3XBUrWHzPBymX3RW wanpEIp00gBVlcWSypxxuhHpq0NiOrVHvAdzuRIQYyx1tnUzS1WGZamcb+c+NTwd 0zjaCRkdb93vgh+qjRQRzaFAdC0j6NpBKwR66no1ODA2rGs5bcbGCoOv+EvV3tuy EFGy4YAQKRAEusu6t9wVnI/ehylIbA/HK9WKmBOxpjv85ON7QeK7/AJc/rKH2P/O m4WkAtkznMzeVcF6FQ2LpQGc7hJM5zTBjzPIQJh5tQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:27 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id f063e4c4 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:15 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:23 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 05/10] t1401: make invocation of tar(1) work with Win32-provided one Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Windows nowadays provides a tar(1) binary in "C:\Windows\system32". This version of tar(1) doesn't seem to handle the case where directory paths end with a trailing forward slash. And as we do that in t1401 the result is that the test fails. Drop the trailing slash. Other tests that use tar(1) work alright, this is the only instance where it has been failing. --- t/t1401-symbolic-ref.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh index 5c60d6f812d..90af3f955c0 100755 --- a/t/t1401-symbolic-ref.sh +++ b/t/t1401-symbolic-ref.sh @@ -16,7 +16,7 @@ reset_to_sane() { test_expect_success 'setup' ' git symbolic-ref HEAD refs/heads/foo && test_commit file && - "$TAR" cf .git.tar .git/ + "$TAR" cf .git.tar .git ' test_expect_success 'symbolic-ref read/write roundtrip' ' From patchwork Mon Oct 14 12:21:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834880 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BC1C1A4F04 for ; Mon, 14 Oct 2024 12:21:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908493; cv=none; b=f1bXB/nBipSGwC7ZP5eHKAmt7s4tBYQ3ilmNK5Ck9c3r77KYuw8Fc1UaG/amcEci5mv5xXWOjLsaJqmciAd7jA5Co1cNkLEGQHBacsfHyokYnEWzQKX8/l5TtGnOCJlXXdYIKBIcWN11iEoXkb4ROkVdT2M3nNpFRQ5OUmozzPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908493; c=relaxed/simple; bh=2BmG3z9TqUOrVHBHSy55Fu9COOiEUUD27aTmDVa4T9I=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BhoZxlE8Wyf25d/zIDW+Vb2+CFQDK8bpRb4jaj6K7mJvRVK/IWx954Qq1Sbk87TgdZI2Fj6i1vylJv+le4eab2zva2DHl6fwvpe+eSMlS8ZWnIbvB8YcuLGZ83FtYHAzbJTeBVdI/3BAu7J5bMlJEFctzIJoLzXLOYUL9H5Msx4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=o9ownwk/; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Rg3e9Gme; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="o9ownwk/"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Rg3e9Gme" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfhigh.phl.internal (Postfix) with ESMTP id 688AA11401EE for ; Mon, 14 Oct 2024 08:21:31 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 14 Oct 2024 08:21:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908491; x=1728994891; bh=YMaCYBozvq tlOyofry3RKba5sBd48rRHsvJAXIcichM=; b=o9ownwk/z0kJXzeVSStqPl5C7Y Y4ZDRMhQwx1LRXGZoPBXkMszD9E229KDRLz8rQV31J3gLfgiFVhYhVbY8JyorZT+ spy5DJAzBKMrwYqK9sVIUiiXJqJ49MeRo6rGplK4VUiv5Gxx7RACGLmkfYQ0EiOR iGOMK4MjB258tYjL1LpTjPPnMQJt3heZCHauGp5syCdj9A7LeGr16FEPZrTQq4tH cKxklt3mEGlpHfkpFjps1rHKzOQaXVGX4GaMK2myZ1trU/WX1YVQdTONYR/KpZry 5/3ELlgxhM2AkgTIXQd47rKDNQZvSUlz6sOL8rKRG5K1JnIPQ/RQ/6/JLl2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908491; x=1728994891; bh=YMaCYBozvqtlOyofry3RKba5sBd4 8rRHsvJAXIcichM=; b=Rg3e9GmesAU3MhZ+D42LioMmThw9xpPFAKG4zrpSsgnq iqc/Tdujk3gBA4oBXGUKTJziajhmLiZ5kawHwtz9Nq9tgaVwXoRlZkKLjpFlbHVU aMs1Dvu4VRhHrEFc5MdQdeRUvbMm6k4wfdm1T5bFF7u01K5xH9XXTgqGJeyuCI0A j58rHDkRbydjp3aZP3BpYR/cvmYfXTldrZfj8+bNPgI2PDQ0SQgrG9QqaAGklCfC WydlaOMpqfzvhkhgxM0sobJCRcyBwQBcBZbc12vsLYDO6pgd7hXNUBLUuC4q+IpS obz1BLYgLMRIJpETU8cKbp3n+5wHgolN/b9yGTJrAw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:30 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 458cef55 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:18 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:29 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 06/10] t3404: work around platform-specific behaviour on macOS 10.15 Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Two of our tests in t3404 use indented HERE docs where leading tabs on some of the lines are actually relevant. The tabs do get removed though, and we try to fix this up by using sed(1) to replace leading tabs in the actual output, as well. But macOS 10.15 uses an oldish version of sed(1) that has BSD lineage, which does not understand "\t", and thus we fail to strip those leading tabs and fail the test. Address this issue by using `q_to_tab` such that we do not have to strip leading tabs from the actual output. Signed-off-by: Patrick Steinhardt --- t/t3404-rebase-interactive.sh | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index f171af3061d..7ce75237803 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -1917,18 +1917,17 @@ test_expect_success '--update-refs updates refs correctly' ' test_cmp_rev HEAD~1 refs/heads/third && test_cmp_rev HEAD refs/heads/no-conflict-branch && - cat >expect <<-\EOF && + q_to_tab >expect <<-\EOF && Successfully rebased and updated refs/heads/update-refs. Updated the following refs with --update-refs: - refs/heads/first - refs/heads/no-conflict-branch - refs/heads/second - refs/heads/third + Qrefs/heads/first + Qrefs/heads/no-conflict-branch + Qrefs/heads/second + Qrefs/heads/third EOF # Clear "Rebasing (X/Y)" progress lines and drop leading tabs. - sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \ - err.trimmed && + sed "s/Rebasing.*Successfully/Successfully/g" err.trimmed && test_cmp expect err.trimmed ' @@ -2178,19 +2177,18 @@ test_expect_success '--update-refs: check failed ref update' ' test_must_fail git rebase --continue 2>err && grep "update_ref failed for ref '\''refs/heads/second'\''" err && - cat >expect <<-\EOF && + q_to_tab >expect <<-\EOF && Updated the following refs with --update-refs: - refs/heads/first - refs/heads/no-conflict-branch - refs/heads/third + Qrefs/heads/first + Qrefs/heads/no-conflict-branch + Qrefs/heads/third Failed to update the following refs with --update-refs: - refs/heads/second + Qrefs/heads/second EOF # Clear "Rebasing (X/Y)" progress lines and drop leading tabs. tail -n 6 err >err.last && - sed -e "s/Rebasing.*Successfully/Successfully/g" -e "s/^\t//g" \ - err.trimmed && + sed "s/Rebasing.*Successfully/Successfully/g" err.trimmed && test_cmp expect err.trimmed ' From patchwork Mon Oct 14 12:21:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834881 Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0DB31A4F11 for ; Mon, 14 Oct 2024 12:21:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908496; cv=none; b=o3YvtHMy6f/4eE0uD59FC3zRI8yTkhd+VYlyZqok2bzi9N9fP9SvNXjqZSkYbRKWDhG/YSlcgZwAR1dCSTNc2cCZ1I5LDkIVB6y4ycMz3lr/VP1JhSsk/6zxqGM67Ec9AClqF1yGICvwH8L3K4J5k+P99trQ1EnczwG142k6sJM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908496; c=relaxed/simple; bh=3Di1PMGv+1pequW/gFp4eOe1BSfvOsP6SJnMYscjywo=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YVOrpTqcz17ags0NVb6ZTLM+UVO261HirSnXxA+4cFvY0QzJn8DZOTtYLn+IInF2gmWx5e+T+/Me+M5bDrJRNNYRF9WgFwHWs0NFB5ozpqQidJV310hCUxuGBbUz/TyTNP1iqeWRlYinkSJj0eEepqMBXXcJqsgrMaPsBeBtq4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=Vqq0R/Y4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TietlaYw; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="Vqq0R/Y4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TietlaYw" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 53A15138023C for ; Mon, 14 Oct 2024 08:21:34 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 14 Oct 2024 08:21:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908494; x=1728994894; bh=febV9xGy+l o581aaQTTofByR03Eq8ea7hVFn3qGA4SM=; b=Vqq0R/Y4n4Disqz82Va4La/ZTa weLxtVk/mFd9HKVEae/Jjw99JYUfxyZ9ceiHci/2KEsN/oKoJH9Yy9hMcK22S1L2 7ND/XO50gTK3Uz0DPlul53Hq+JLnk8pB1tVNLdjEGGqyDkX2YUqbODuOQWfPc41a /ykSSLm9hWybLkP7KrRqgMeP9WMhkGctn/+c7pLfOsJOUC7BNfUgtTvV1gFqxCsv Mt00G77D0/Cok4rSh7gm+ZIwCkEVjIu4WOl+hGkKqKPQFhZTMLepQPytWqBErXqO rD1C8YDfshF9QNOsBoWZ87AhKlBYA+utEQqt6SygjgSSo6GDibBW17hhHrRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908494; x=1728994894; bh=febV9xGy+lo581aaQTTofByR03Eq 8ea7hVFn3qGA4SM=; b=TietlaYw7BYGpZaW2YVxHjxw7hIePUVJc3znQf6AGdSg pYkCSvu/whomysP30v1jZldVY9VsMVjLuT67oXb5ppBw3LXqg+F0EyljJ91WdN6p A45NZT3wp4yxh7AxLt4YaLTRzWNYyLMmsLGtXkh7k05ai1dhSahOhnBsZnU44xKp 3dYxyukldQv6dBAB9uA6j365urs0GicfuMveSHVwNjQon5uabOf4QI+ymGHR9Q/A yxf4ak/80F9ck6ul563MNucw6RJoln1Sf6vgWu49dN2ZHD91xn3A6KfIjCyPPUMm 1fespVe40inzEoLJDuNCBp3fBVkfi3SW5NOfc4Tchg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:33 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id be596d2a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:20 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:31 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 07/10] t5500, t5601: skip tests which exercise paths with '[::1]' on Cygwin Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Parsing repositories which contain '[::1]' is broken on Cygwin. It seems as if Cygwin is confusing those as drive letter prefixes or something like this, but I couldn't deduce the actual root cause. Mark those tests as broken for now. Signed-off-by: Patrick Steinhardt --- t/t5500-fetch-pack.sh | 14 ++++++++++---- t/t5601-clone.sh | 11 +++++++++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 605f17240c1..416522c86ad 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -774,7 +774,7 @@ do # file with scheme for p in file do - test_expect_success !MINGW "fetch-pack --diag-url $p://$h/$r" ' + test_expect_success !WINDOWS "fetch-pack --diag-url $p://$h/$r" ' check_prot_path $p://$h/$r $p "/$r" ' test_expect_success MINGW "fetch-pack --diag-url $p://$h/$r" ' @@ -784,7 +784,7 @@ do check_prot_path $p:///$r $p "/$r" ' # No "/~" -> "~" conversion for file - test_expect_success !MINGW "fetch-pack --diag-url $p://$h/~$r" ' + test_expect_success !WINDOWS "fetch-pack --diag-url $p://$h/~$r" ' check_prot_path $p://$h/~$r $p "/~$r" ' test_expect_success MINGW "fetch-pack --diag-url $p://$h/~$r" ' @@ -806,11 +806,17 @@ do p=ssh for h in host [::1] do - test_expect_success "fetch-pack --diag-url $h:$r" ' + expectation="success" + if test_have_prereq CYGWIN && test "$h" = "[::1]" + then + expectation="failure" + fi + + test_expect_$expectation "fetch-pack --diag-url $h:$r" ' check_prot_host_port_path $h:$r $p "$h" NONE "$r" ' # Do "/~" -> "~" conversion - test_expect_success "fetch-pack --diag-url $h:/~$r" ' + test_expect_$expectation "fetch-pack --diag-url $h:/~$r" ' check_prot_host_port_path $h:/~$r $p "$h" NONE "~$r" ' done diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 5d7ea147f1a..9fe665eadfb 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -530,10 +530,17 @@ do ' done +# Parsing of paths that look like IPv6 addresses is broken on Cygwin. +expectation_for_ipv6_tests=success +if test_have_prereq CYGWIN +then + expectation_for_ipv6_tests=failure +fi + #ipv6 for repo in rep rep/home/project 123 do - test_expect_success "clone [::1]:$repo" ' + test_expect_$expectation_for_ipv6_tests "clone [::1]:$repo" ' test_clone_url [::1]:$repo ::1 "$repo" ' done @@ -542,7 +549,7 @@ test_expect_success "clone host:/~repo" ' test_clone_url host:/~repo host "~repo" ' -test_expect_success "clone [::1]:/~repo" ' +test_expect_$expectation_for_ipv6_tests "clone [::1]:/~repo" ' test_clone_url [::1]:/~repo ::1 "~repo" ' From patchwork Mon Oct 14 12:21:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834882 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E585D1A4F30 for ; Mon, 14 Oct 2024 12:21:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908499; cv=none; b=NfbZj4n6SQFh/Tb0BmmRgywOk7d+aiH5he1KUWw5SixkvLSEPFoX5Cnx9YaZcVsrlz7UNjLvXPbR/Iaaku0LcJ/8wSf0nSN6A47py7XeY4o8HzqR/+h2ONnaVBIy6JwOt812BXxeZpK0/sc8PwFyVxH2ao8hpFwpDYt/Rigj9oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908499; c=relaxed/simple; bh=AivzP14oKcMpocfx/+iJ/3wqhpuJyBerkIfxff8rzn8=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dRWSwZjJlp/C68Uv+KBFzgW7ychgkb3acs4nDZ+1/05fPmuhZ/6QBchewJ68WKrPMnFG9hXnmnFWjvcJmuLJ8dNNnVXrFogIuBjvsCw8yqHv3j9LP5oSAcUxmefvLPh+XnPU6Mos6oLvUT2aB6Ddvc50niuJjPt33p87v+vMUKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=BaYD0v8U; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JE2+dplQ; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="BaYD0v8U"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JE2+dplQ" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 32E7211401DD for ; Mon, 14 Oct 2024 08:21:37 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-10.internal (MEProxy); Mon, 14 Oct 2024 08:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908497; x=1728994897; bh=1B2585PgIM xaSR2K8p8wDvhkiDm40GBB5/JuaUgNzos=; b=BaYD0v8UFJlSLwkkeV+UhtWWnk aMJhT9/ynKmHelbBegKBOt47aiii1h5dNlXSafFk7E2x/FqJqth7149VX9LWgPQU Rk5YVrs5waZ205+i7tVy4PIyngylRCheU3/MdQO+1v21bHXxciyn+tPvG9GVoZs0 FD2WeI8C+loOnNoGxGRqQQ2TiW+k/MG+hacIzCnBHoZgyqT0P8d+OI0CzsiUFQUr QBmpBR85LyOC6yHsFt7nCIyiLSTERBEKBcWnIaHMYDTzLhP9xboAxa7BeGguTzgY ZjRWrkAmahS7nrlpgiFYV2DT5uKnSm6hJ9gkqGrzLrCpiKZW2I4ThHH+TcKw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908497; x=1728994897; bh=1B2585PgIMxaSR2K8p8wDvhkiDm4 0GBB5/JuaUgNzos=; b=JE2+dplQ8zgG4vaX2OxbA7b7O/P4JH2J3QwJTlmT5akT UVN41JODZgLn8Hd+BpUz+bNjki0ylsz3cK3l25IaD15xzE9WOdno2PJ92pUQvY/4 JDVsGz0/35sqiyErcWYkVET06CWKO4eFgd7Kzq0vEEqH0UQCgvrdf1/6+dvpOcfZ YNHXBuPUvldlEvNO3nqCrb2zK65FzmJGiKlwUfjH6Yl7nQLPWbl6CIWu0mH9LuO4 X2cYmBTdncuV6t2VoAc44qZBqvHz35o335WhGj5Iogt5M5NADPNnZxyi6d2c1E9V PVFWO7UWPf7yZfTEEAtw3a7Wk6Re5itln78zYL5N7g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:36 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8f1bd89c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:23 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:34 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 08/10] t7300: work around platform-specific behaviour with long paths on MinGW Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Windows by default has a restriction in place to only allow paths up to 260 characters. This restriction can nowadays be lifted by setting a registry key, but is still active by default. In t7300 we have one test that exercises the behaviour of git-clean(1) with such long paths. Interestingly enough, this test fails on my system that uses Windows 10 with mingw-w64 installed via MSYS2: instead of observing ENAMETOOLONG, we observe ENOENT. This behaviour is consistent across multiple different environments I have tried. I cannot say why exactly we observe a different error here, but I would not be surprised if this was either dependent on the Windows version, the version of MinGW, the current working directory of Git or any kind of combination of these. Work around the issue by handling both errors. Signed-off-by: Patrick Steinhardt --- t/t7300-clean.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh index 0aae0dee670..12ab25296b0 100755 --- a/t/t7300-clean.sh +++ b/t/t7300-clean.sh @@ -747,7 +747,7 @@ test_expect_success MINGW 'handle clean & core.longpaths = false nicely' ' test_must_fail git clean -xdf 2>.git/err && # grepping for a strerror string is unportable but it is OK here with # MINGW prereq - test_grep "too long" .git/err + test_grep -e "too long" -e "No such file or directory" .git/err ' test_expect_success 'clean untracked paths by pathspec' ' From patchwork Mon Oct 14 12:21:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834883 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5E431A4F38 for ; Mon, 14 Oct 2024 12:21:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908502; cv=none; b=atjBbaWm+68H7jfPwYvi5z7OEq7wIWjgvClphkALWizFeZ8JwkjOPSDlvZjbE/hwxhUkKw5fqwOjHTrtTR22ogDpFIWFBoVU3dpJLyRBhPLMHw0FbY7dIAIxQta7UDA9BnsXBDl0GyG7+wsg5E3wsUTMcacOcHzryT27HvZztAY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908502; c=relaxed/simple; bh=z5fcBVOlJRoUYkjxuCCNUcYz7u24YP7CyLGAoi69czc=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SxWY3rjudeqJaI3F1ST7b7xtIOB8pciJi/ot5JRxpgmh6EvyJqGlPwfYZmDowXq48b6uJdoB7L5Pv8yyLHvbM5XQ4u6KMJy14uc//jcZiFEnU7dt05bAAx13b8RDKYpqxmcnchwysLepJrnpf4I/fLXaAlXYjPOdAZqkRSPxRMs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=fEDKKncT; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VmAiUXoy; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="fEDKKncT"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VmAiUXoy" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 1839E11401D9 for ; Mon, 14 Oct 2024 08:21:40 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 14 Oct 2024 08:21:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908500; x=1728994900; bh=OjO+BO/SB5 iPDMJKqNhiLMNDSumXSGUa9S6Qe2/1BaA=; b=fEDKKncTXwffVIEp1KTUo60pTs roFLTSDmJ17lhFjIMTWeBrZECtNlxXlbkE08odVwxC+0h3FnTjdVx14ze4o0wDtA d+PpbKFGRhvhCQjT7A/FE4lDTq0dHkx201lkAA7ya5KyLH6/E1LdlR3JKAZ0l0pV 4+rAgFsaNY3hY0zyRCGymbDFX3pcX03wwiB59sZO7CKOhR9z9sfXrC94+0dstXBu jyubYyAyiWwwzSQYf9NUCO7zJ/2LE5d2MU8yLdGGTkw9TTwes9Wc0VAT03E2O1jF GgRX75wdtROK6RfwFskfUg26MS7GHCzHY7x1xjdSa/GhjD+n+vJJUbvBAYHw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908500; x=1728994900; bh=OjO+BO/SB5iPDMJKqNhiLMNDSumX SGUa9S6Qe2/1BaA=; b=VmAiUXoyk1F6ZkjONnyz/Xd1zi9KjIg01SLPvitsBrNF 6vR0w/JeUMGUUTRqSM5FSwcw3uBYXpUE7o8a4h0D+oRH/Yt1P00w5SzbwIcU1CaD QsVbh0JIdL7CmDhH1MDTYOpYAJAy3vA9UySwfEd55/nN09s5qtGZgmQGGnvTuSB8 OEMba8QJm8p6/JFWuSNs29wS6qW/xD5eEZ30LBDb0A/bsz5QxWAo3dBZgsfM+6JG 3TdwrrwTk+WfCQIwY/dcz+1nLysTam/lt459lD9IG510pqd3jC4B+H95Ce8cVfuE qzQy7E5Eve73zUT3AeIPk9+7BZzX3JM0NKUyIm1tIA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:39 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id a06f8c92 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:26 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:37 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 09/10] builtin/credential-cache: fix missing parameter for stub function Message-ID: <8cce69e5ba63d02ef4eb1e8cf56f47443b5bb1dd.1728906490.git.ps@pks.im> References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: When not compiling the credential cache we may use a stub function for `cmd_credential_cache()`. With commit 9b1cb5070f (builtin: add a repository parameter for builtin functions, 2024-09-13), we have added a new parameter to all of those top-level `cmd_*()` functions, and did indeed adapt the non-stubbed-out `cmd_credential_cache()`. But we didn't adapt the stubbed-out variant, so the code does not compile. Fix this by adding the missing parameter. Signed-off-by: Patrick Steinhardt --- builtin/credential-cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c index 5de8b9123bf..c51f7fc2ade 100644 --- a/builtin/credential-cache.c +++ b/builtin/credential-cache.c @@ -189,7 +189,8 @@ int cmd_credential_cache(int argc, #else -int cmd_credential_cache(int argc, const char **argv, const char *prefix) +int cmd_credential_cache(int argc, const char **argv, const char *prefix, + struct repository *repo UNUSED) { const char * const usage[] = { "git credential-cache [options] ", From patchwork Mon Oct 14 12:21:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13834884 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3CC81A7056 for ; Mon, 14 Oct 2024 12:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.159 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908505; cv=none; b=KvJe4dkOCbXE1RqEdFXf6hJRdQsUkB5DNVH7M3V8Q46/uGIyFzjD45NsY7swTKAw9yZJdtXd35nZgFU5b92hFIA5+S5XzZXFTyc7QldicPslcxsKIjBlJt8+SY5CzEvoSipUICMYgVm5s4V/+UGveXvES4CLowLbJCM3+PeEeK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728908505; c=relaxed/simple; bh=7qF58BLt+iICgHW+tFTbVgpiTxnRkJd++dU6o0JiNaI=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=s2LVgcJTdGeETVeiwtt+FnRg0GcF9tIaFejLJ+aME2zzxWn8k13vQm9jMIkx5wpcZQOHTiWQG7snuYC5dJdYS4+Bhk9WyV6UXZW+07LNJU6Y/wQkRSJWNPQvN6AErckwvgTc2K1jZAIlIp7beGpeItPqSgVI1ce+6CcRTlxi4Jw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=HzaJK8xg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=qNFB6Obw; arc=none smtp.client-ip=103.168.172.159 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="HzaJK8xg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="qNFB6Obw" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id 05B8911401EE for ; Mon, 14 Oct 2024 08:21:43 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Mon, 14 Oct 2024 08:21:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1728908503; x=1728994903; bh=frPNzSFShv Upg6kOQTiAPslU2HEDujTyZKdkJlbeRrU=; b=HzaJK8xgmzDD79J5c1gEo7rzkH xBlKWEcrftAoO4UIcRzqgkPOpomcWu1stgQeXik+U2x9k52eWQWdfnL/dQwiwqcR AUKaAQwxVmBPPVXtxtJlpi8LZsamVh+AwwOKIw41DsGcrFCDgAKc+xoo7dWEqFCg MyfUMWZ1ZBzpDTuq4bnQGEADPTFTNriJi+bdUR4SYXOuJUDAarqXQkfCCQa0shAB rDOGeVf3iVaU/wZ3g/1spYOTuMtalOGACu4az9FFqJt9JXvOO5BCQfF7SxiaV7B6 wrZWDc/88BlpBtHKRgFGBKbsNmlrC8juJNXDtQo0Pw+sq+ZUh7YirdgdoWHA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1728908503; x=1728994903; bh=frPNzSFShvUpg6kOQTiAPslU2HED ujTyZKdkJlbeRrU=; b=qNFB6ObwuuqUGoWBWPEbfitRyziMdTMFQ2/aVu6RJbao QAtUBPHvnx4lYDWQoTvV4fO9BokuC23j4/E97KQ/800SuKwohPpORyQ7oG6tHFj6 OVi1TmMERXdMowqj5t50GlqqpoTQcnQgYA1UzkFDGF/MYlDcQeg9qJQysRnlv5py nrLebonXO1Ecy+nClljwgiSuXILrcuLAdsU66H6+jWuQL38hxRknVSfnFWoukyxY eihntQJP6edB1dwEIMq4SvGXNER34pzFL8Y+Stpt/pnZXjWunldyze0NbxsWJxxD 2fjdz48egqiRpH58D7IyplLM2+wB4NOZtXtWeTthoQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeghedghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuf fkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhh rghrughtuceophhssehpkhhsrdhimheqnecuggftrfgrthhtvghrnhepheekfeefgeegvd egvdeffeehtedttdffjeeuffelgffgheefleffleejvdefheeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspg hrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepghhithesvhhg vghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Mon, 14 Oct 2024 08:21:42 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 22e98d20 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Mon, 14 Oct 2024 12:20:28 +0000 (UTC) Date: Mon, 14 Oct 2024 14:21:39 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 10/10] http: fix build error on FreeBSD Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: The `result` parameter passed to `http_request_reauth()` may either point to a `struct strbuf` or a `FILE *`, where the `target` parameter tells us which of either it actually is. To accommodate for both types the pointer is a `void *`, which we then pass directly to functions without doing a cast. This is fine on most platforms, but it breaks on FreeBSD because `fileno()` is implemented as a macro that tries to directly access the `FILE *` structure. Fix this issue by storing the `FILE *` in a local variable before we pass it on to other functions. Signed-off-by: Patrick Steinhardt --- http.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/http.c b/http.c index d59e59f66b1..72973175a85 100644 --- a/http.c +++ b/http.c @@ -2290,17 +2290,19 @@ static int http_request_reauth(const char *url, case HTTP_REQUEST_STRBUF: strbuf_reset(result); break; - case HTTP_REQUEST_FILE: - if (fflush(result)) { + case HTTP_REQUEST_FILE: { + FILE *f = result; + if (fflush(f)) { error_errno("unable to flush a file"); return HTTP_START_FAILED; } - rewind(result); - if (ftruncate(fileno(result), 0) < 0) { + rewind(f); + if (ftruncate(fileno(f), 0) < 0) { error_errno("unable to truncate a file"); return HTTP_START_FAILED; } break; + } default: BUG("Unknown http_request target"); }