From patchwork Wed Oct 16 08:12:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837889 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 DFE511B2193 for ; Wed, 16 Oct 2024 08:12:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066377; cv=none; b=K8exBVLMoyHTinibkAsJHLJKmV1fQB8lukqUB27pckgkYP/LBzGjflTqU0XpAnk4uVG7uxargQ2IHlxpX7WiU/RFzx/tXfESkvNPpOMyf4Xp55c2XGVLsg/XeV1oOQgNCl7We2EQOdgQfMhroCfvX5L1LmH0NFxaDqOOYCi8oAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066377; c=relaxed/simple; bh=hLfCNLvMOBb89LEU+TtRPa8R3ybKDgxyUzmGaWU4zOY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=US6ALidVHchyineAkUuqpWvy8IBv/Hf+CKYbH9fVZs3NPgAzNT2GlP4WMlvRFTZLTeD4q7WS3GabOZ4uz/gKoHNKKVfCtwVC+k147LafUAPIxw8vWf8fFzJ6qGAY9Sg2jlOqaHHmEmeb1OzeKcOqmF1u1zBi0yRN+XYXFfcbXO4= 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=N3Bv2Zx3; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VahBhSEf; arc=none smtp.client-ip=103.168.172.154 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="N3Bv2Zx3"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VahBhSEf" Received: from phl-compute-12.internal (phl-compute-12.phl.internal [10.202.2.52]) by mailfhigh.phl.internal (Postfix) with ESMTP id EBFAF1140136; Wed, 16 Oct 2024 04:12:54 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-12.internal (MEProxy); Wed, 16 Oct 2024 04:12:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066374; x=1729152774; bh=hjj7S20kZJ rEZVr3DWHwGsMz2ZsAl66LRT0d7/enBGI=; b=N3Bv2Zx3vIqzu9oq2gKrZQQS/r t6wRGr5Fv1UvJ7uutR0o708M0fFcldYqyW7m+gbtdoSB986Gcc41p8w8mXMy/JVr 7zfH/fdgAr9G26Cawvv1/K6O0KR8IsKt4dRPE/cmOwMi2zwWFiCZ4V2BoOzJrofm QXzz+CNH9jXOXsw9h6ffkzo6zwAHRZSigsd4yzg2/YyROBRcJ6nkzRq81J4CY43y DTTfpm5uY/BUh+6omNCKqg5Vai+KiwtXqTZypyJ0BRf79hpWel7UpifNAy64TNgN gkMEeIwj5vEI7mZcyo8t5PYqIYMQSpvXMburRWgINZGvGdGY1kqRpUnYfv/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066374; x=1729152774; bh=hjj7S20kZJrEZVr3DWHwGsMz2ZsA l66LRT0d7/enBGI=; b=VahBhSEfD8so7QenSpQCkc2Qc4klne2iGeooKktRKO7U iRww178Vc2hr4qy0tKFZoNUNGUuvIYlegFAPtkV2qllrnqDAq0BtfMHCJufRMRjJ AubroSWd3FXBwN6r6uh7DPgT+pheR8tBgjkQ3A+M7izYpGnpwWIN6SziBud3zjnZ nnpo0GqcHuoHCk6ah2+ycQNrcgEDi3vWjd+3wIs/lXUXyb0CUT1R1qovZ7XGio5A XkybSTVpiTgxstG7ARMgwvIfxA9ohXH9dDolmmVVWrwmmeRmoPsdi+DAUmBoVBL9 0MjZSC6Z7XjJ52IApDmor1ASsm8IVi2YKRiJhm2vxg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtth hopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhunhhshhhi nhgvsehsuhhnshhhihhnvggtohdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:12:53 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 59b80e27 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:35 +0000 (UTC) Date: Wed, 16 Oct 2024 10:12:51 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 01/10] t/test-lib: fix quoting of TEST_RESULTS_SAN_FILE 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 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 Wed Oct 16 08:12:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837891 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 3AC571C4A2B for ; Wed, 16 Oct 2024 08:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066380; cv=none; b=tiT5zWxoJJt/mhcnTZIbIS9it5NmAjAIC3szXYOiU0o+0d8o6ailxPN6xEapFY2MOm1CW3hEu8ngm1Ido5/0gkcxJgkgpdEvdW/UrLVWDitR5ZLEPUGrRPvERRRKluj/5oquNth+R8Q0Ga7oUByBrZiqoph0wpLHX7GXVOG7gOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066380; c=relaxed/simple; bh=UaW6/lJ6JJWpMYHRlBFOIIFgSnazt0uhmd0sFwdSBXA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lXi9PzYC98T2C1kaliUWENTVnBvfqEqsfolu/37cwuEMLnIA4s0EgfjZUfktCMr2ahyEiAYUeG4JfBlcDORfoEvwwVg9/YZquZ3E7eHcmvu7Vz9ZktVvkK8TLivxvbzfz5tUGDG2YvtCbRQ3pZK6C3aQO/XeHhrzIkqOHwCBHNg= 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=MK68/Rms; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Dhp4bd0F; arc=none smtp.client-ip=103.168.172.149 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="MK68/Rms"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Dhp4bd0F" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 4C0821380103; Wed, 16 Oct 2024 04:12:56 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 16 Oct 2024 04:12:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066376; x=1729152776; bh=4BvfaP9mSG61YuZKJjvzAi/WweD5+RrbtOHUCB3WTRQ=; b= MK68/RmsYSAYDr/TJmnq+797WuLxNfGCAWfX6m7viLjlXfEJuS2FwIFSpySvRn29 VTVZIdCSGsBdgftMoz69eivIzIU6qcoxy16GDnaURDZDBWW88qKCEa4RVaF2MuEc pLrIDFmE4xt4Tl/XXX354HPjer6QUSxQwAw5aDV7b/1SQpp9y5vtA/i9odYOhDtz QWo7FbG3AJ/whH1KfeJAs3T5icQxKYpyKEDz0GdkcS5WWzvChLrxaLpTHdqSQEP7 JIFVH1pONAcxqHl43BqOjWPcOTU4jZZcCwf2I0dexK3jZQWxyDlyInYkMw+JczYp AU60DCpNK43rzoYE1JBHKA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066376; x= 1729152776; bh=4BvfaP9mSG61YuZKJjvzAi/WweD5+RrbtOHUCB3WTRQ=; b=D hp4bd0FJdMufZn3/OumGImQp+61m7JpwV9AbCYktuB7cnL+ndoge3M5iIcUek3n9 vEAfwvbVR9jGQieaeUZT95K1MSduCqEBRNKwUEH5Zz2qBVH8zq30mgbASv+nGHGq SHA8uj5L+amf4Va30jDUJFYfA2r0IYpZ1vYAoNtus04OtRv3mZmrB/En1HWDu76b SA5GVzR35Irn1/S1f02uS9+zDmt+tI8AOMHFR/x0v9PqBn+vDmAgUl7I+bkn4Jiq iOBgu20OzNIOxtTWLdLeAV5Vt4Ivler9BjvDWuwdP8Sk81wlQZH8XSy9Oo6v08B4 WX/y8UwcwfRdCzLONFzhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggugfgjsehtkeertddttdej necuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrih hmqeenucggtffrrghtthgvrhhnpeegiefhuefhkeetueeijeehheejveetveefvdfhleel hfeigeejtdfgtefhieeiteenucffohhmrghinhephhhtthhpqdhfvghttghhqdguuhhmsg drshhhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep phhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepghhithesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehm vgesthhtrgihlhhorhhrrdgtohhmpdhrtghpthhtohepshhunhhshhhinhgvsehsuhhnsh hhihhnvggtohdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:12:55 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 03c92326 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:38 +0000 (UTC) Date: Wed, 16 Oct 2024 10:12:53 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 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. 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..0ecb0597c9a 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 !MINGW,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 !MINGW,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 !MINGW,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 !MINGW,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 Wed Oct 16 08:12:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837892 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 64A1C1D0F6B for ; Wed, 16 Oct 2024 08:13:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066382; cv=none; b=WZYpaqzXFWfaUhGNCWKy9bpTnDJk+Z4N7pB3EIsBNH9xbuD3cVcEI/G6MRatxkMGihbcnNQOs4ivQGbwXAC+Q6j+R7rvxmZGAachdfQABREUPy7AkZEeKv9kkk0CGJ5k0AM9kpqcAXZy9KopQ304MxuFZdvnKRgvb7upzAUImdg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066382; c=relaxed/simple; bh=n0A7Jc9eGhxSM4IzpqM4TS3JdMe3whp3xtYH79sSuFQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ihb45M1gfRx5PJ3mtaijMmOsWct/gdZXv72/Tn+zWqAs7LGWKdNTI7ETPgqoqZ9G6jLt0ApNvKydbgOgcN62RPk9lSvPEnzPdRZoIOPzXz3NXJi1FobeNv3Rc3bM9CovV8L6ukZee7q3hQ1Eu1Pf0GgNirZwoNnutp6rFlDMB/0= 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=QjjLw7g+; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=b800QYPb; arc=none smtp.client-ip=103.168.172.149 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="QjjLw7g+"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="b800QYPb" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 805D913800F9; Wed, 16 Oct 2024 04:12:59 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 16 Oct 2024 04:12:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066379; x=1729152779; bh=Y3q+0LDusJ XB3OB3K5AJ3qj6qWUbRw1RNRQDnKGedRE=; b=QjjLw7g+mYdn3Zt6mgpyCzyFyt +zfQ+W0ZuRmt7sEELtPp2B75EHdsxVJF2O7c5jOZJG2FJ0MW4vPRUtVp7iRxlov/ 14G77bhA+LKbiUrpDdBoi6yAENxjFfUBEOvcN1bx+OrpV/Y3DSKtF++9hq84jGsa 0EHYAciJ4lFSAkulLln8igTDhZgUSJL83I8In+GXI5vqwTht7Lw8sWL5mwliP58Q 5yD2YkqF3pXom1k8rBPmCnZvLbk1mdM+IweWEHxjknqnzwDmsY93XARkcF540V/m 8g6tGdivzcfHYOMRzzujZZa3R33cnrJ6U+OZ9M22hCZDhLqxNjdAJ0NhOiqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066379; x=1729152779; bh=Y3q+0LDusJXB3OB3K5AJ3qj6qWUb Rw1RNRQDnKGedRE=; b=b800QYPbBxO+wmQ/jftsIMPtaMweRnHPR+8WC0El6oom Ke4mbKF2AIw4e7khGqjmuOeFV8/iermRPCXcsdaLDOOhrnFdlKR17rWNz8+M8h0m EQPxnOdgsIuhJ1GGyRFYrv6zXJc2jo9b4vVRqFCvG5oNBRvWJdIbWi6GByuBz/vc 9nM10MYcJq2hgCXs5my4AJhCGsH4bG08OJngcnoMADJ1r/wesq6jkUiqfADqLGyE piMuh48LLE0fvisbIY3tqbGSk+1e0OjPSBi7T7bEIyhKUMnlucKGlbicKgMvr4bW p+WElJsOjLXc5hjFOFKVPU+ijFGFL/3vpkKAhkxgqw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtth hopehsuhhnshhhihhnvgesshhunhhshhhinhgvtghordgtohhmpdhrtghpthhtohepghhi thesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:12:58 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id f9e4c3cc (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:41 +0000 (UTC) Date: Wed, 16 Oct 2024 10:12:56 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 03/10] t/lib-gitweb: test against the build version of gitweb Message-ID: <52d0b252a1ce73b0258301b836785b152c8ed066.1729060405.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 testing gitweb we set up the CGI script as "gitweb.perl", which is the source file of the build target "gitweb.cgi". This file doesn't have a patched shebang and still contains `++REPLACEMENT++` markers, but things generally work because we replace the configuration with our own test configuration. But this only works as long as "$GIT_BUILD_DIR" actually points to the source tree, because "gitweb.cgi" and "gitweb.perl" happen to sit next to each other. This is not the case though once you have out-of-tree builds like with CMake, where the source and built versions live in different directories. Consequently, "$GIT_BUILD_DIR/gitweb/gitweb.perl" won't exist there. While we could ask build systems with out-of-tree builds to instead set up GITWEB_TEST_INSTALLED, which allows us to override the location of the script, it goes against the spirit of this environment variable. We _don't_ want to test against an installed version, we want to use the version we have just built. Fix this by using "gitweb.cgi" instead. This means that you cannot run test scripts without building that file, but in general we do expect developers to build stuff before they test it anyway. Signed-off-by: Patrick Steinhardt --- t/lib-gitweb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/lib-gitweb.sh b/t/lib-gitweb.sh index 1f32ca66ea5..7f9808ec202 100644 --- a/t/lib-gitweb.sh +++ b/t/lib-gitweb.sh @@ -48,8 +48,8 @@ EOF test -f "$SCRIPT_NAME" || 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" + else # normal case, use built version of gitweb + SCRIPT_NAME="$GIT_BUILD_DIR/gitweb/gitweb.cgi" fi export SCRIPT_NAME } From patchwork Wed Oct 16 08:12:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837893 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 C0AAA1D172E for ; Wed, 16 Oct 2024 08:13:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066387; cv=none; b=nsxJ7wuS8DRFvzdcPIM9ndENnbTao3KnIewXAZxguZ4zTmd3hFSd6Wzr0sRuC3d3MhhvzTOwNw77rCgYvRfGsQq0Q5hq4JKCzxuYlz7zHVXvgQC4qM0sC97LvOnEK9YEykkWMWcLbUR04JHkjKGupIonkzTi6hUZO6D0KDxyQGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066387; c=relaxed/simple; bh=Nqjg2a5IkK6/ZlCxiwMUNx1Yb5gNfNmFkFqUFzpma6U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Da8XRxxLN8nsy9WgfI7JWZIbhDFv3fUsazPSYcy5FLevwCtb37mVMOAQvByxBtBnRZRfT4OQ8fVzuyHn2KQx/mNHXQuPDGE5qQhIeHo1mQxUevLjhO0F4TKVOr2vmUrbPBdFSuGC5JIkyhK1kvu3Ud1ZCXgtYkpG1xtnCiGLsYc= 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=UI37C8NC; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=aey99kOT; arc=none smtp.client-ip=103.168.172.149 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="UI37C8NC"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="aey99kOT" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id AEA911380123; Wed, 16 Oct 2024 04:13:04 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 16 Oct 2024 04:13:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066384; x=1729152784; bh=tyn/Jj7fgo 8+SLdCu9RDXNInfdUUAuCS0IFtRuJQuo8=; b=UI37C8NCyBCZYd3NBTj9BAv2BH 0xh4+dGn/9A8DAWyz23Fj+U2JqQGBrl8cxAOaW3pADWdxnMaj65dUAGUqgfDWGHz 1j0GREUai+UE+ydBh9sLkY5MmG/SfmnwSJC/8txizXTz/Nx5VDU3GxLS7NZzZ3lg autILILJwleb2VOlM5njlj1JQOkZdtTrn/VV/8hf3OT78Gi8LjaYbbagzkZmsbL6 6c+sr0SixovehR742ON/JGTKlHMsF3XQzwMBvmikvf+pW0pHoYKPyXj+lBOF+UjM ArvMfCob/yEY6uq1pCmwvjtdbh7SgxMLRArfTOOnZigwRhBf9j2ZdMw6DgYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066384; x=1729152784; bh=tyn/Jj7fgo8+SLdCu9RDXNInfdUU AuCS0IFtRuJQuo8=; b=aey99kOT5ykZFHbo/FZnrsWDVIM+n0fQd6w71a/hVsgh AuS6hGIdOY3/FMA5rSJwJhZtZjh3fAUM/K9wTmlxoZQJ6xrauK0r7Yy716Ifal1I msJ9dhVy6CYRR1EumCax0p9+O6jk+ReQnZuLyrQMoko0Ad2iNzJnIxsMrjhB4wU+ 18UCe4v23cB8JWp73aOurg5eoouddbxDNp9kO+EJAAXMgrmEC1HKVjoXW0xmn7ge VnOMy0n59Nsp0B4WOMX640OGH89Vw45jDvCUoN9Os+lqTVWJ49YTGTh/pkNnrwFP WeFWOKu1Etv1FmHvI+ypEWeABNdjOLwxbjRiQWexBQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtth hopehsuhhnshhhihhnvgesshhunhhshhhinhgvtghordgtohhmpdhrtghpthhtohepghhi thesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:03 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id b62d43ef (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:46 +0000 (UTC) Date: Wed, 16 Oct 2024 10:12:59 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 04/10] t/lib-gpg: fix setup of GNUPGHOME in MinGW Message-ID: <89957caf6ad2f3af4b1c7298ba8253f07b9b0455.1729060405.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: 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 Wed Oct 16 08:13:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837894 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 D6B891D1738 for ; Wed, 16 Oct 2024 08:13:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066389; cv=none; b=EM3Uqm8FFQzokWPcSKL65y/tIJy50hL/CXNzsAV/6jYHl4nvayzhSC/MKm/HTx2agpxLFNQJ7GB+lvQUOSPEXDuGdzEBEw7/g4Oe+6xqMTAPHdlY12DflN+DsAa8UgauAyeAM56z7Ul4hdakdu2mQbBglsa9kYaCY+sJvvhOdrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066389; c=relaxed/simple; bh=6wCUDR2uWwl4w7N5YG2d3RdZ2ut+HDil49fwgmEGuoo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q7AH1jrO3Bt7ZAwRmCKt1b4ciILMBzcHg1IIlOhZwb71WZVmORNrh4UVH2EeXhzvXEhvujzFLZmSkY4ySGefeD/KA8vrhj+FFKU8ImGIzoXKT0ZLeijSE3a2z13JEybyuJAY3ooGvsrlWCxg+43Eo8wnXAze5vgMwbSSONm3au0= 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=EafSycnN; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=kWQI1x26; arc=none smtp.client-ip=103.168.172.154 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="EafSycnN"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="kWQI1x26" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id E2D351140149; Wed, 16 Oct 2024 04:13:06 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Wed, 16 Oct 2024 04:13:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066386; x=1729152786; bh=jLJmF5/uZk 1UixwX0/0kRWJ9Rhewqx2nglz2///Euug=; b=EafSycnNwnnoYZD+0Q28i5OpKA Cbfszq3ixgJKPNF25GyEyR/OmVp2pBLpKz5/GLP/sUwWuldIlwj6UKA59EWPWT1r 6xaq1bFLGJRyY0Lv3Be8IF330aHMGC1P/QS9avO75wqGA82Dik+LMvA9RZ7F0vyR vYSMK59iYoZo6sDJ28NIUKKyk+fhZH0NRPfjJHol1e8TBSyweCabpjKtg17HXJxO L5H26yZ4eZxg2QsegTwmLZ4Fezg7IiyJUjQ+cYB9MFhTeBacgeAfdJ+6U5VgoK5/ qurry7Te42HaVH3aljdp14ZL2Clc3eB+DsOFaRihALONChJmIiXW4pFT+L6w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066386; x=1729152786; bh=jLJmF5/uZk1UixwX0/0kRWJ9Rhew qx2nglz2///Euug=; b=kWQI1x26v/eNOoa7gHUhkijyPDPV9QPgsvt6AWuL7J+F gMqVREa3YgrP5oqFs6KZOdXwFTjIEAD/1RNn3U0ThrPcCuZ66Eh18iV5HpI+q7Nn XFjSUOb9/TVjizmzPLHg3hciGidZA9FxB5PeQbF+h7fB2FeUjFO5KOGDK244nVb2 +5Dg1DxDtTasIdQHD/GFy7M6gxv36+07evQctN+30edSuV4HgVu0eZxX03cuGQO2 qyFgdvK5nHbGIMcjLZ0lH78cHy08RIIWZK1f0e0q/j+Fi04bQpyF0DWq8r8zJfLm nG9O9Jd+jLfIN1LutB0oSruhXF02AOR5JcO4fmTJyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepshhunhhshhhinhgvsehsuhhnshhhihhnvggtohdrtg homhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthht ohepmhgvsehtthgrhihlohhrrhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:05 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 718215c6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:49 +0000 (UTC) Date: Wed, 16 Oct 2024 10:13:04 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 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. Signed-off-by: Patrick Steinhardt --- 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 Wed Oct 16 08:13:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837895 Received: from fhigh-a3-smtp.messagingengine.com (fhigh-a3-smtp.messagingengine.com [103.168.172.154]) (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 020EC1D1738 for ; Wed, 16 Oct 2024 08:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.154 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066392; cv=none; b=B+YySwZ/s1ZrbsNKeFs/hxbtGnflHXYMrI9Z3IwyBMeFyPdouM/JZGi8bN2Zca9EazZIFpFs7p+JzR0cQEEXQKniNKivsdltJk2or91eebXGslHxN0Wkb1ReBNWbJPGAuOFTgUcnWHlCy6GcPLPPQIqHIWQyEnHK/7O59HgGEfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066392; c=relaxed/simple; bh=Jy5H8rd/HsHj6nvgVLd3dUgL5Y3/moeUXfdhK3b1uEk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sR1zOgg7+fpz47UaFphc+u0B1REwUo8Zc4eT95F9fu5FyFmQ4wMxXHFPWnKJhgMkfXDS/GaDTw5NtyvTj8H7pwOZxOux7B/4EYuxWJlwkpV7cU1DiP+nLurtAtitHF5bBQP6AfxIIjl3XL/RbBRwX+hEte6/U/01YsglwzvGX5E= 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=NsPH2Sgw; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=oq2JP6Zo; arc=none smtp.client-ip=103.168.172.154 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="NsPH2Sgw"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="oq2JP6Zo" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2B6571140149; Wed, 16 Oct 2024 04:13:10 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 16 Oct 2024 04:13:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066390; x=1729152790; bh=+Pe2v1qzcY 1ZGDdQ+1cWhvEwUASL9kaRlE/RiwKSBV8=; b=NsPH2SgwM1IADbI89KBwwa1P8t FJw2lNURtiHxu1+rOZ8axsmM5if+k4SRExoJ+LvW1QqegnGjSwoWGtYEwqMyCsjt RvNV0AFIEbZewmY2tFHB93QUF8pqliZ1NL/Cs1gFDKI4qV9XmcTTuTbaPTBUpIzn CoEQ29ofn3OG2o0vlf8V+QesAu617p9P+ie1mZq0gRbtIT5CWyyGd54KujyKrK3p zTfpy6sqDspvzq4sJhjzqyahQIaFip1XL2EsoiG1LnNh1Y0pDc+yOxhBUNEtlnQz nzL5sW01cenmdbxwnD0p6cUWVlLyeDcpw5Zs3TAat819toKzOKY2gimxXDNg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066390; x=1729152790; bh=+Pe2v1qzcY1ZGDdQ+1cWhvEwUASL 9kaRlE/RiwKSBV8=; b=oq2JP6ZoZJwbiJUTlHbMOuM6Pb2eOBnZZTITzoT2wUpj xXdsGHhnaMf7JGGwm/OWY2Kvr9iWqti1/T1dd5udbjPrpwTDJIpcy0PMHXXiqVKY i1bLqDFxkMTGM4Fp8UwqzAH1pZTMym7cHMw5zMKkCe1DdOMaTSTZXHhCh2PgRftc Lu2KZIW3bNHkLhGJ8qgQGZ73MympZ6IlkTOT44aXpth+ngOnJl1z9zxtbPRJoe67 +Z7xYLEDcQcN73lFp+9kVBxlCwZmmXYW17JHXefnm7ZUOlpAS/EGmCa/vEBfLVQS Rs6PhhX2FnN/YneJMfzpuDfZUV/aNIyvMr/xRK9Qvg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtth hopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepshhunhhshhhi nhgvsehsuhhnshhhihhnvggtohdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:09 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 21a3060d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:52 +0000 (UTC) Date: Wed, 16 Oct 2024 10:13:07 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 06/10] t3404: work around platform-specific behaviour on macOS 10.15 Message-ID: <29fffa5d86b5efef9647eade7c3fda4d6d6e6ddd.1729060405.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: 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 Wed Oct 16 08:13:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837896 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 0D4841D2700 for ; Wed, 16 Oct 2024 08:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066394; cv=none; b=Nfd7yUDYPy2ApqvwLvpUxTTndDXflk3/05EeJNaIrvNz2tgEIIWv6tR0WhrCAW9YnjHpYf2a6+DH6K9PkbEQchDU6gSTFo7UtjWAtrOQLVMEcuCQnk9pxNOqb2ewUOGWg2iJJbSE49gzR+yb+IiA7y+A5lxRiO5t3LZCsJ1zIK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066394; c=relaxed/simple; bh=c3RTVMk8oO4k7R13SnzHdXs0nruzngj3MksK/u0DS74=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EOilHOUFjDno7fkF150Ls53GiTv3rx/etnHJ1A+BJJ9GORfeTfPYrxvL2SJO6XhB+5Sp0hO7uWShgYngP+GGqnXJRXGG+esqOGa8ikmLi1O0oM/7hpcOZra+6cTii4H1oBi+V2XiYx+5E39KlRoDAoogYwRryxt1R2OI6sagpRg= 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=ViiX5KkX; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fjxrMmj/; arc=none smtp.client-ip=103.168.172.149 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="ViiX5KkX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fjxrMmj/" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfout.phl.internal (Postfix) with ESMTP id 595C11380044; Wed, 16 Oct 2024 04:13:12 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 16 Oct 2024 04:13:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066392; x=1729152792; bh=WbjcHA7+bU yzAzOGLc5SKECgOtm3PzmlwBh85bErodk=; b=ViiX5KkXm+se3wzn/OxKrc+WBJ ySBOYmG90/pi9r4jQv60EEN/FZKDVyAnJb2p75NaKY2LP1wqODGWRo1JYbMJmRGx wD70Bol1LUW8fPfPqO08+83QM3pc3q547T2+gc5lKJzRkwMtVerw8Te0mXYGfZWn 5qqq/PVBREJhf0NM8eO3YeBoD+wQ/ZF+8UkI8+914t7Duv8LTKtj+6aan5QtjI4p lJGyRgYSc4zuXipM0h1eq6DURZkcK9AJhNyYL7WPalhNV/fzoHGD557neNTu/83K EdMYSpU948ESbPxXZVJmRAhN7lx8Ld5SpYs62PeOoeNBNA5jp/y1Z5ciw4EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066392; x=1729152792; bh=WbjcHA7+bUyzAzOGLc5SKECgOtm3 PzmlwBh85bErodk=; b=fjxrMmj/Eoj6QCrruOZAuhPGj2hMU6t566qQs3VOqMuy QFjRq5P8MOiTYTsi9UgxibGo6/0M9xTORFbFp5C1Rl1gdcCr40bohD93FFdH2U8W uzZyQ/hzeyLugrSYeaJqh0OPL683x7mXDbs4uoqEOtfkHRjgE8em8nlqtzq/yq8V kCmIbdpn4mweeojpK8Y1bt1ygMCQ+MVPx35l+D6ZOgGOpjkCAAiaZq0Xx6MtuQb0 lf9lkohbc4R5j2IM6Z3IzeGyNQoTbmM8j1SzGOICqYop/R0n49gTacp5TxfGbbIB hCa2TTHSLTeIURzErzDG3rtNgETEfMayjlIXmPl+9w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepshhunhhshhhinhgvsehsuhhnshhhihhnvggtohdrtg homhdprhgtphhtthhopehmvgesthhtrgihlhhorhhrrdgtohhmpdhrtghpthhtohepghhi thesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:11 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id e80a4be6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:54 +0000 (UTC) Date: Wed, 16 Oct 2024 10:13:10 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 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 Wed Oct 16 08:13:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837897 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 49E511D1E7A for ; Wed, 16 Oct 2024 08:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066399; cv=none; b=YvHHJ1XGx6gqqh7Tg0K8Iif07h27P8a9SoPtZTlW/25xuLDZdzO/OMWAGb0GzBCLXNjcmhqa10q3UTPMbWAJr97zJDqvJZeBk/TK6xh+UMWYwaly7sIMIoQlRRML9jUyAAZAPayEAAND7C6gYfQY1CBxhD0wM6NrYSwo0oeY3XY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066399; c=relaxed/simple; bh=by8igO0q7de+8Pr4v/o3o+r6WtjlLD0Y7USo0Ulpkbw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G+ctIBeKfl20io9feMyL0YLUHtepwEYxegJ880f9ovwcVGqdg3X7T7nm6DNoqmqCh4mHwrqe9dKqQcZyOAzImI48BJY17mbukV2JSFe/+ieoHoPoRX//goHHa+r8JyaS/erE33lidkua3yjOEk6VPRaZJznfhCaTiDbL8hEDAJ0= 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=bo044EVK; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=HvtFw9T6; arc=none smtp.client-ip=103.168.172.149 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="bo044EVK"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HvtFw9T6" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 859DB13800F9; Wed, 16 Oct 2024 04:13:15 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 16 Oct 2024 04:13:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066395; x=1729152795; bh=ptVDxD4kjQ 9TY5IlxMJteqiioPQyfYws8mLwL4HXbUY=; b=bo044EVKdmi8pcWKbOF+G4ph96 lcQeUvXkI2PZtgSlCokrIYtV0+y6lTLG4h680GgWkQ2yOTp4kQ47kK3BPWMltXus BGwEop1VZf5pzKVLF8/vUgA8YMiscuQxZEgZ1l7zAmWAGNydeegXeeaww8huAWoT VV8nUaVXAPJJaVhKtRqM68N8BvAcROguoPnRhYrGPzQjn4vDcYtWLqvID6tXm9Dn mrqsTgv8YtfPXwLZmaZei+3tBE4poRCoNniqmvdxclOIogCHWQotBvp4LTDA8/jk I/om228dxIlDHgpblbO6uLg1G/EkqjX1cVJ9GwC+T+48jmt/72Fqco60NoFw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066395; x=1729152795; bh=ptVDxD4kjQ9TY5IlxMJteqiioPQy fYws8mLwL4HXbUY=; b=HvtFw9T6/HXQemHa7OQG/u/BUxpNr+ASkJ9e4xOZSd1y LpqEht4mTu9IC+trkoojF4Q1yiER31FmYsFQdBzNT9i8MXTP5DFLWmZ5o4LF67qP OzP9sdi2NpNFrCf0F8zq/LN7QomLZROp/AyUp9JLpL4YOke1XgxXfXg3YN9G2qX/ XUFev8yb+mJDqcsx44wK8qybpKaoMGXsatBtb3Qt1iAeYWterUfitNlGbiUFwDg3 J4zybKO+ObHX/XDbmWqmn/WPMMFksfeOoqwVPCyzBJLpRxJuVb+0K1HjRtYNCpWV HnMLZb6hKot6qDVFKXSGU3vmX0MG5y333oxif3b70g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepshhunhhshhhinhgvsehsuhhnshhhihhnvggtohdrtg homhdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthht ohepmhgvsehtthgrhihlohhrrhdrtghomh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:14 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 8ad8d2f7 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:11:57 +0000 (UTC) Date: Wed, 16 Oct 2024 10:13:13 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 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 Wed Oct 16 08:13:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13837898 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 847231B2193 for ; Wed, 16 Oct 2024 08:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066400; cv=none; b=Wsmc1j9zy89l82eqin6J81A79M/CtfakXsV309bc9TTZ5wO6p8g+iVfHFAjKkddC+R0OVCPG/214zAebS+/POX+E7Dp1dsGO6hP2BI5isdCCFxgPmSCGh5OwmUOsDX956rZsSlpPV/vVCE+g4B3bIBOkPGJJIAZejR3KwLGpSSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066400; c=relaxed/simple; bh=WGsUMN/OhbdSxQHTpJKsXhGTNq4EYp55mRJedIl61jM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iCdiTHsV9DPu49YJ84jeJEJhRhEk1a+w5yJVA2//A8Onv+OfyLril91x2+1ElGgIu0ueUHUqzVrs+4bEw8MadIr/X+PgrZIYDk6hoM0+JuGMsUsq659kcX+tX0NcbD+EbRE+FDXnET52MBcLLSVIPhyzxH8kHSt+exP1sAY49W0= 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=Q0b772il; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Fpcn3Xe7; arc=none smtp.client-ip=103.168.172.149 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="Q0b772il"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Fpcn3Xe7" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id B01D31380123; Wed, 16 Oct 2024 04:13:17 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Wed, 16 Oct 2024 04:13:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066397; x=1729152797; bh=Ippqaah5zo lH/JiAY87V5UgrQLa0e7sxtGw+W68iWCc=; b=Q0b772il1f5UnpZi80ZMKfDvdO mYdxtYiMvFB7PzmvdazNDE1aBM/AcYWuT/s6hZt1HMzWIHdQK07PxQ64+ujVR2D1 36u1w4+TlI3/0FYxDxa8DKheYOGKF551NbzFjlBoInIFohl+cqBysOBoIenzTmgS OAznQ1O8Amj4BnYjaEPv9lDbTOyKh2YDXD0eYXsdSUfrnWGcCdoRL2Tq2/AOMrX9 72U9CohgPYqrM15Qxq5rcCdaadK81HEevM5rZhk1g8VJh3yO+dLs1pGL4JC1IAqW CKSWb/VkumbX03yHha+2aEhGZGfpbREvcw2UpihzboHhPUOkaR6aDzyOtZ8w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066397; x=1729152797; bh=Ippqaah5zolH/JiAY87V5UgrQLa0 e7sxtGw+W68iWCc=; b=Fpcn3Xe70J3BOKa5kz7RCqPT0P0zO9Bk9atIxm6MGs7R PjUFZAw4BsoXPFioKTXsUiG6HMTfgaw7xgt+VHF/9QEVuEZXiNWBRdyZO/WfXKyo ymHpiyzAfMhfyJ0aapkxFHRU6iEmYom5eNX/DwEd+o36PBAE5dGQvA2/nx4iuM90 Al+MYbY+awP/tFF66GfiJgPNj4QMHzyXY/o61Aem5zm73sgga6BZ+OEaznFVZjhF SWRLvSw/rmxx5c1jtb5D7kjeMd1VWWIE4UPeN9ANk+35moFVyp+0yuCxqnCoeRpa 8Vxqvn6Vl9dvlUKjt2BhmQzG6RLbK6h5uydyCqdulw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepshhunhhshhhinhgvsehsuhhnshhhihhnvggtohdrtg homhdprhgtphhtthhopehmvgesthhtrgihlhhorhhrrdgtohhmpdhrtghpthhtohepghhi thesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:16 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 1d911474 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:12:00 +0000 (UTC) Date: Wed, 16 Oct 2024 10:13:15 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 09/10] builtin/credential-cache: fix missing parameter for stub function 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 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 Wed Oct 16 08:13: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: 13837899 Received: from fout-a6-smtp.messagingengine.com (fout-a6-smtp.messagingengine.com [103.168.172.149]) (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 CE5891D1F4F for ; Wed, 16 Oct 2024 08:13:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066405; cv=none; b=UseVMjoB4GNrPLNZLm0rCwK/3ek5f5DFP7hh+LZuTnMnoAj/Z7Hw2lcDSAcA83uLTx5k2CThwfZMtNFDHXDjUZd+dFDlQDhj5pNVEi94nRrA3jcWsj5FFn6EW8nECKOtnvbJ2HbcMiaWDAT/2PzWUFxwWo7kWfrKiDb0cpeycH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729066405; c=relaxed/simple; bh=l3xYCrq9sa8N1wr7lgRlrBuA0pgklwmFnpVOuzSOvck=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=TSrhq/6hAw9fGm30V5Gj269hs+dVFBHLKco2KLhT3B9vBvo1mG0uOijiK0FtAohfWS8+pRZM/tOwCctRUlwSFb/4Lael4iRfUW5Rh10tLz13aLPv8zBJEMHgIphhgsCwvs/g8T2m87+EwplKc986WxceObI660eE8MTnZ6HTd3Q= 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=FG+mbFrg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=l4PJ9Wad; arc=none smtp.client-ip=103.168.172.149 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="FG+mbFrg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="l4PJ9Wad" Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 0427613800F9; Wed, 16 Oct 2024 04:13:23 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Wed, 16 Oct 2024 04:13:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc: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=1729066402; x=1729152802; bh=UgXRcLeHVC 4VVMna5Jzrkg9TsA9+N54tfntKt7NIIDs=; b=FG+mbFrgTKlrbbmQPmGguYt2R3 6nWZ6S1+CIMZOSMHTyy8JjMKQVYZWqR0y+qUqETidrePUY7mtk+TvHzgjUjVn8XG 0KQXGcw8flpzJh9Ml7KWpDrXDKw1y4PYfoQDtaGMX/JFENdog/i7mRdfHVsQ618O Zce+AKCNDSF6ddgNhd0Tx3tXK6GgZ93ZJ26FV4D9On/fKZ4CcFOXmcyRbujikyJ8 bRTXZzF1M1rkDW0zd64lfF3LaQahN8ONoh0TIMJ50qc5uWgz0XDcEJ0vUwiNmMgm a5alSH3mx6WKcILR0ZXr33I6cUOVgnjwU87PUeF7nNTDuY1iU0+Q/Q3KTr+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=1729066402; x=1729152802; bh=UgXRcLeHVC4VVMna5Jzrkg9TsA9+ N54tfntKt7NIIDs=; b=l4PJ9WadnmV6VI4mgzTVn9K/7hbWPbfTHZwzPlTyqXqU mfZ6kEdK1vqRvk90ydE4jojdSokzjKpM71UG9gOzLtwUrnCBUi2FuW2jreEPIzdC /w9hBjki8jLhymXrODUclvKJddkCH1U/yvo9eZnIgKwOnUCYvPmvUNRXzxumTnNr 8k/qEJgzy9/kv6n+Bf5ejo8ADBDVPkV+v6DU0pOS/Jadfg1y3SKewl8Rmf8YOf7Y NFvsIUSaZGs+SxXpE8z3dIsrH6tvCTlq/s0lnNiWORwTkSak+q0TlaipsiL2BFqf fjBjJJKmXsDJr0VmTtUJk9YS15nvq7sx83T2fFY+wA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdegledgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvden ucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehpkhhsrdhimh eqnecuggftrfgrthhtvghrnhepveekkeffhfeitdeludeigfejtdetvdelvdduhefgueeg udfghfeukefhjedvkedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphhssehpkhhsrdhimhdpnhgspghrtghpthhtohepfedpmhhouggvpehs mhhtphhouhhtpdhrtghpthhtohepmhgvsehtthgrhihlohhrrhdrtghomhdprhgtphhtth hopehsuhhnshhhihhnvgesshhunhhshhhinhgvtghordgtohhmpdhrtghpthhtohepghhi thesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 16 Oct 2024 04:13:21 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 635e1675 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Oct 2024 08:12:05 +0000 (UTC) Date: Wed, 16 Oct 2024 10:13:18 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Cc: Taylor Blau , Eric Sunshine Subject: [PATCH v3 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"); }