From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-0.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 8CC771F4D7 for ; Tue, 21 Jun 2022 20:27:36 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=pobox.com header.i=@pobox.com header.b="ShgPWj2t"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353377AbiFUU12 (ORCPT ); Tue, 21 Jun 2022 16:27:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352338AbiFUU10 (ORCPT ); Tue, 21 Jun 2022 16:27:26 -0400 Received: from pb-smtp2.pobox.com (pb-smtp2.pobox.com [64.147.108.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 218D92E9EB for ; Tue, 21 Jun 2022 13:27:25 -0700 (PDT) Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 60FA5137243; Tue, 21 Jun 2022 16:27:24 -0400 (EDT) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=k88wfT+upOaERvXXFubv5Zo3KTEzLE5ysdNhxV MGdYc=; b=ShgPWj2tuXL2I0fS4qdV3XPna0YBW6AzkwKI6pNR2eHzt3FHO8/7lJ VWoS/WpqAVyW9sm84zoHvO9+lshNwavRzch8PnCAY1VfcZUPdN2KQx+fUJpWxRGA alOY1bWvOdr0c0ghPy8hkhbvz0DS12lP4OvaGR1SPk2NdwXXgm/rg= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 55338137242; Tue, 21 Jun 2022 16:27:24 -0400 (EDT) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [34.82.80.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id AE4C413723F; Tue, 21 Jun 2022 16:27:23 -0400 (EDT) (envelope-from junio@pobox.com) From: Junio C Hamano To: git@vger.kernel.org Cc: Derrick Stolee , rsbecker@nexbridge.com, Jeff King , avarab@gmail.com Subject: Re: [PATCH v2] t5510: replace 'origin' with URL more carefully (was Re: Test Failure t5510,t5562 - was RE: [ANNOUNCE] Git v2.37.0-rc1) References: <00a401d884d0$32885890$979909b0$@nexbridge.com> <8d2a0a36-1d2f-c723-db1e-8978e5d03d1d@github.com> <00b501d884d7$d8ed1200$8ac73600$@nexbridge.com> <495bd957-43dc-f252-657d-2969bb7ad5f3@github.com> <484a330e-0902-6e1b-8189-63c72dcea494@github.com> Date: Tue, 21 Jun 2022 13:27:22 -0700 In-Reply-To: (Junio C. Hamano's message of "Tue, 21 Jun 2022 09:35:26 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 8EF7C51A-F1A0-11EC-8D5C-CB998F0A682E-77302942!pb-smtp2.pobox.com Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Junio C Hamano writes: > Yup, a solution along that line was what I expected to see from > those who write Perl when I saw the discussion yesterday. Here is what I queued tentatively. This is not exactly new; e1790f92 (fetch tests: fetch as well as fetch [], 2018-02-09) first appeared in v2.17.0 and we can live with the same glitch for few more weeks ;-) ----- >8 --------- >8 --------- >8 --------- >8 --------- >8 ----- From: Derrick Stolee Date: Mon, 20 Jun 2022 15:52:09 -0400 Subject: [PATCH] t5510: replace 'origin' with URL more carefully The many test_configured_prune tests in t5510-fetch.sh test many combinations of --prune, --prune-tags, and using 'origin' or an explicit URL. Some machinery was introduced in e1790f9245f (fetch tests: fetch as well as fetch [], 2018-02-09) to replace 'origin' with this explicit URL. This URL is a "file:///" URL for the root of the $TRASH_DIRECTORY. However, if the current build tree has an '@' symbol, the replacement using perl fails. It drops the '@' as well as anything else in that directory name. You can observe this locally by cloning git.git into a "victim@03" directory and running the test script. As we are writing in Perl anyway, pass in the shell variables involved to the script as arguments and perform necessary string transformations inside it, instead of assuming that it is sufficient to enclose the $remote_url variable inside a pair of single quotes. Reported-by: Randall Becker Original-patch-by: Derrick Stolee Helped-by: Jeff King Signed-off-by: Junio C Hamano --- t/t5510-fetch.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 4620f0ca7f..b45879a760 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -853,7 +853,11 @@ test_configured_prune_type () { then new_cmdline=$cmdline_setup else - new_cmdline=$(printf "%s" "$cmdline" | perl -pe 's[origin(?!/)]["'"$remote_url"'"]g') + new_cmdline=$(perl -e ' + my ($cmdline, $url) = @ARGV; + $cmdline =~ s[origin(?!/)][quotemeta($url)]ge; + print $cmdline; + ' -- "$cmdline" "$remote_url") fi if test "$fetch_prune_tags" = 'true' || -- 2.37.0-rc1-99-g4626346e14