From patchwork Tue Apr 15 09:57:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 14051838 Received: from fhigh-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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 B40DC288CA3 for ; Tue, 15 Apr 2025 09:57:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.153 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711040; cv=none; b=AGU+ElNnfmOOJZTW2J00T3QpgOsQ6RG5mWSmpTxvpdtAjVM6AUb7aqwIa5quRmu2m7LlvSuaO4AqBrPZTRGuAlKFknCRESkPSc5iXwU+/d8lbV8D1RIECyktYHYOO33izO4k1TB6sv7DSaLIo9mnmL+4ErbpWaR+0dopc4q10eA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711040; c=relaxed/simple; bh=V9vrXurmkYJgWyoH7kbXoDrJfgsQYcJrgToGhRR5GRA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l2d0PO4D+mChu607QPyGMRs63aOlGY7/r6TIxCHDCl9xdfJ18p6Kc3j/z6ESBezXfL/Jyj0tQoINIiTj1/m1CCQMQrTSQtt7RyRaP1FluPC9rN46rvlnPrKcHUDl4pkptXVET+n1o7rDhR3j78TMrPhLZzR9IKBhTPkKKmBo9NM= 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=m7Hp3ljm; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=h24KJsBI; arc=none smtp.client-ip=202.12.124.153 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="m7Hp3ljm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="h24KJsBI" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id A419925402A0; Tue, 15 Apr 2025 05:57:17 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Tue, 15 Apr 2025 05:57:17 -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=1744711037; x=1744797437; bh=ab2Rr84K4wwwrfQSRN099LAqhrSMofyZLz66wj7KGu0=; b= m7Hp3ljmXZi4FoP5Oe5LJ/qtE6lLjhDU3lP0fxHyiG2QlgP87pr1o4rR3Dj+5etO KOfNdlkUlGashVmIqAyScSUE6wb6hcdPB3x7SsfgaETnGcjLd+ogSKCvpliBjRzx XtkmDvGwpiXueSRMk+KgcaK1xy34TLtNFACSfOdT+XhuwfL5gjMAeAU+CFvR7IzI oi+XqjAZ1IdBWQZULRrF5lkuSwLD7TF6z60Ydbo9bW1m1rnshlUlMrc/32hEgaDg pHWtMlsaQLot3lA/ybK0G/IPAjlRX9RiQu5Z5EjlLGVfxcBvtyNPCB2RiR2ilob+ ZnFMI3fVgXaQteWKbwb6ZQ== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744711037; x= 1744797437; bh=ab2Rr84K4wwwrfQSRN099LAqhrSMofyZLz66wj7KGu0=; b=h 24KJsBIdAGf5wfla2bkVfATvVxhqEsxGzVII7hkzf9TOv/zqsdcmg2mVWdXGH2Uy 700MMp0HYuhglvDfmVTHKZ2eLb7Qth5s6NPC7LTweIxjG5SnxAaxWccKsvaZzBDj Cmfld0p5aDLT7DRjfPgH0pAsGwIFus5OJ8FoxyPDxSyk/3JvDNx1w7cggzG4IUKk uwe1vqnhSfKSXJ+9tpbYlyzbxUx68m4eR3bEXq2ePmq7Da/hO4vxQGPW9flS6foe FFYV4LxXtntsSLJYZPo5h+qL8GX1dePGLr3cf+P6Bs1z44LE/1/9OYEzl6B9IrHl DpL4ny9u/20Z52HW7l3GQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdefudekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertder tdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhksh drihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteek udehjeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehjohhhrghnnhgvshdrshgthhhinhguvghlih hnsehgmhigrdguvgdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Apr 2025 05:57:16 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 2b507b59 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 15 Apr 2025 09:57:14 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 15 Apr 2025 11:57:08 +0200 Subject: [PATCH 1/4] filter-branch: stop depending on Perl Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250415-b4-pks-drop-perl-v1-1-c6addf175858@pks.im> References: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> In-Reply-To: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> To: git@vger.kernel.org Cc: Johannes Schindelin X-Mailer: b4 0.14.2 While git-filter-branch(1) is written as a shell script, the `--state-branch` feature depends on Perl to save and extract the object ID mappings. This can lead to subtle breakage though: - We execute `perl` directly without respecting the `PERL_PATH` configured by the distribution. As such, it may happen that we use the wrong version of Perl. - We install the script unchanged even if Perl isn't available at all on the system, so using `--state-branch` would lead to failure altogether in that case. Fix this by dropping Perl and instead implementing the feature with shell scripting exclusively. Signed-off-by: Patrick Steinhardt --- git-filter-branch.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/git-filter-branch.sh b/git-filter-branch.sh index 3a51d4507c7..24fa317aaaa 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -295,15 +295,18 @@ then if test -n "$state_commit" then echo "Populating map from $state_branch ($state_commit)" 1>&2 - perl -e'open(MAP, "-|", "git show $ARGV[0]:filter.map") or die; - while () { - m/(.*):(.*)/ or die; - open F, ">../map/$1" or die; - print F "$2" or die; - close(F) or die; - } - close(MAP) or die;' "$state_commit" \ - || die "Unable to load state from $state_branch:filter.map" + + git show "$state_commit:filter.map" >"$tempdir"/filter-map || + die "Unable to load state from $state_branch:filter.map" + while read line + do + case "$line" in + *:*) + echo "${line%:*}" >../map/"${line#*:}";; + *) + die "Unable to load state from $state_branch:filter.map";; + esac + done <"$tempdir"/filter-map else echo "Branch $state_branch does not exist. Will create" 1>&2 fi @@ -633,15 +636,13 @@ if test -n "$state_branch" then echo "Saving rewrite state to $state_branch" 1>&2 state_blob=$( - perl -e'opendir D, "../map" or die; - open H, "|-", "git hash-object -w --stdin" or die; - foreach (sort readdir(D)) { - next if m/^\.\.?$/; - open F, "<../map/$_" or die; - chomp($f = ); - print H "$_:$f\n" or die; - } - close(H) or die;' || die "Unable to save state") + for file in ../map/* + do + from_commit=$(basename "$file") + to_commit=$(cat "$file") + echo "$from_commit:$to_commit" + done | git hash-object -w --stdin || die "Unable to save state" + ) state_tree=$(printf '100644 blob %s\tfilter.map\n' "$state_blob" | git mktree) if test -n "$state_commit" then From patchwork Tue Apr 15 09:57:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 14051839 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41DF228B50F for ; Tue, 15 Apr 2025 09:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711041; cv=none; b=gosUhoKJrk1KP0b/4x58QGpzlq266WxWzmv0sKd14FHT9t5i+iWumc6PTymQ04i6dl/DYdhA/8N3pY9in6pFA4LtkMD6150I1PoOAdpBXlAoa3bvvWxqlruU0n35MElr3f80+FbmCkzjHKln5ron5YqoX5Qmc2Kqdr/xC3Q/o8E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711041; c=relaxed/simple; bh=JLNRgfeKVg5LSZ36ef/q0qJT+doE6AdoGGpc4oglxds=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lCnkFqPffrt+gc82glvnoNJ1fme0/qS83mpztgJ67HCWVzaEuYq8chFtShSfpVq0bJ3vfHIO0TM5iTPGNoZ7R3449Flg7BHm7bk84RXk6Dot2fJa9kEJ5b7ZI1BYa9tXDoYzLOHtpVrn3/0hL09fv+heSUhrdmOmsVA069CnRZs= 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=p4PewwQB; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=m52QoiLb; arc=none smtp.client-ip=202.12.124.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="p4PewwQB"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="m52QoiLb" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 2450F11402D9; Tue, 15 Apr 2025 05:57:18 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 15 Apr 2025 05:57:18 -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=1744711038; x=1744797438; bh=TZBf0dw2NYkdq0RU6sGf28pG6gDj5KjVAnrDy1+B55E=; b= p4PewwQBO6e72fBotShdMleB4vBJ7XNF6TlYSYgEZJmN+iFUzfXMECrWQmWBG47T qvCgKl7DD99AuT7i4JG29BdB4FA/Tu0z+gt1rvEoCFSBmoVRRbeNgsGXhijttXqS sT1lMq+fQDbnlXfnIfKJ5PrTqxJ0Pp6ivZkz3/IkYycCzM+LtARvzSlkthFtKNLF y4qLOoMxKkqJhhUcD2G2CcyM5NjSS/FMbfOJiYe2LegSLhNS/kt/vlCYRYNps7w0 rva3ie+xcOREw3HsqCNDQsBe4DwP8hwExfuZXXGBJsZTItETyMtwXBvLlbbk6m61 bJhiqyo+jCenpMo60PZXvg== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744711038; x= 1744797438; bh=TZBf0dw2NYkdq0RU6sGf28pG6gDj5KjVAnrDy1+B55E=; b=m 52QoiLb23t5xIvS4yQNRYRNyHWae0thti6Lp4KAwU91vTJtOAdzLozfZKmgs1Vy2 B1tLx7EwPiSGBfBF78GH17MfRotRbvG82snW67Rt37Vjq+c1l4akFyUa7kfcfBK7 vO6GkkvatWgGFyVeTctPPZbQ4NH4d7cU/38vYja8fp39QDwIA4XOafrWkw8fJvoh rbscNHqZvZJ6RbXXwf4Eiy/+/QEOUVLZQK59f+8KQ85XrJhGrrI3pfp2pR9jBZPQ ixgtQ7JlDC7nK/xfXgngefbW4ny/kUisblf+Z0vUZEYpK6lgdq9MQcWjD9udXK3d E7U3iJz/U+UuxuHEeSdkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdefudekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertder tdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhksh drihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteek udehjeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorh hgpdhrtghpthhtohepjhhohhgrnhhnvghsrdhstghhihhnuggvlhhinhesghhmgidruggv X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Apr 2025 05:57:17 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 6475c703 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 15 Apr 2025 09:57:15 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 15 Apr 2025 11:57:09 +0200 Subject: [PATCH 2/4] request-pull: stop depending on Perl Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250415-b4-pks-drop-perl-v1-2-c6addf175858@pks.im> References: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> In-Reply-To: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> To: git@vger.kernel.org Cc: Johannes Schindelin X-Mailer: b4 0.14.2 While git-request-pull(1) is written as a shell script, for it to function we depend on Perl being available. The script gets installed unconditionally though, regardless of whether or not Perl is even available on the system. When it's not available, the `@PERL_PATH@` variable may be substituted with a nonexistent executable path and thus cause the script to fail. Refactor the script so that it does not depend on Perl at all anymore. Signed-off-by: Patrick Steinhardt --- git-request-pull.sh | 74 ++++++++++++++++++++++++++----------------------- t/t5150-request-pull.sh | 6 ---- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/git-request-pull.sh b/git-request-pull.sh index 775ba8ea11a..59276fe265b 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -78,41 +78,47 @@ fi merge_base=$(git merge-base $baserev $headrev) || die "fatal: No commits in common between $base and $head" -# $head is the refname from the command line. -# Find a ref with the same name as $head that exists at the remote +find_matching_ref () { + while read sha1 ref + do + case "$ref" in + *"^{}") + ref="${ref%"^{}"}" + deref=true + ;; + *) + deref= + ;; + esac + + if test "$sha1" = "${remote:-HEAD}" + then + echo "$sha1 $sha1" + break + fi + + case "$ref" in + "${remote:-HEAD}"|*"/${remote:-HEAD}") + if test -z "$deref" + then + # Remember the matching unpeeled object on the + # remote side. + remote_sha1="$sha1" + fi + + if test "$sha1" = "$headrev" + then + echo "${remote_sha1:-$headrev} $ref" + break + fi + ;; + esac + done +} + +# Find a ref with the same name as $remote that exists at the remote # and points to the same commit as the local object. -find_matching_ref=' - my ($head,$headrev) = (@ARGV); - my $pattern = qr{/\Q$head\E$}; - my ($remote_sha1, $found); - - while () { - chomp; - my ($sha1, $ref, $deref) = /^(\S+)\s+([^^]+)(\S*)$/; - - if ($sha1 eq $head) { - $found = $remote_sha1 = $sha1; - break; - } - - if ($ref eq $head || $ref =~ $pattern) { - if ($deref eq "") { - # Remember the matching object on the remote side - $remote_sha1 = $sha1; - } - if ($sha1 eq $headrev) { - $found = $ref; - break; - } - } - } - if ($found) { - $remote_sha1 = $headrev if ! defined $remote_sha1; - print "$remote_sha1 $found\n"; - } -' - -set fnord $(git ls-remote "$url" | @PERL_PATH@ -e "$find_matching_ref" "${remote:-HEAD}" "$headrev") +set fnord $(git ls-remote "$url" | find_matching_ref) remote_sha1=$2 ref=$3 diff --git a/t/t5150-request-pull.sh b/t/t5150-request-pull.sh index cb67bac1c47..270ce6ea487 100755 --- a/t/t5150-request-pull.sh +++ b/t/t5150-request-pull.sh @@ -7,12 +7,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME . ./test-lib.sh -if ! test_have_prereq PERL -then - skip_all='skipping request-pull tests, perl not available' - test_done -fi - test_expect_success 'setup' ' git init --bare upstream.git && From patchwork Tue Apr 15 09:57:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 14051840 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DED3128BABF for ; Tue, 15 Apr 2025 09:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711041; cv=none; b=ZkgwaniJhU03IViHRWajQnWPbt7xccC342taHglCkrzsflxSr7imDoCjDQAM3EIH4ShiMdW1T1Bm2iPXzoLjSDul7C7ffdlnDfCSRDKMhg4lBmUsrImcX+kDzyVHtsubvKr6SRQj0WF1rGFX9T2FU7TWU3f5YmVD/tE4s6BpO2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711041; c=relaxed/simple; bh=wlbe2qtXNnkBrjK60p9wilU1zsyLu/D/ihOqijsgMn4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AlQCf7u8DLeQBM61KQhleVDdRSsx1ZHqgcxhSKSoy6JscR8+4ngXCNAI7NvqpNS2BYfRPbtsvEpVZcWWWn+b5Eo9JuJ6gD1EdSYkk5W7wsAVaikPwFRXYF82dkUWg8FuIkuwRGEWcxkMdjIqhIuXC7OvzBazPUTB1kO5s1Q0EcY= 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=r/waJWYM; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=MCOt7HyM; arc=none smtp.client-ip=202.12.124.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="r/waJWYM"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="MCOt7HyM" Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id D5B9711402E4; Tue, 15 Apr 2025 05:57:18 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 15 Apr 2025 05:57:18 -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=1744711038; x=1744797438; bh=0rhgTQ42jtsNwOZPEo1u1J4tYBhgJca0C9fLoG7I2J4=; b= r/waJWYMKc3OG+mMahm3XGikNqKUwmxZqpaPdnEO02kiVSOf1kn/swilEvfnNdIH fjXHkjOOwDU4uDDr3J9w6fGBN6hiErk32kbLPV1e8pNIUbNv07DQVtDU7ErZYkFm 1G30gPOMgLaH7UQAOExOD+kimw28jn0f1wO/VS0D8X7en/4XQRuSfrj+CRbWhQhD jzdVpuWZtYRtfEUPCAhlAb06Fsejo8N7VTcfGozTYh6S0MaZQtQhxZc8dGzOUWNm fR1ZJaeGNJUQIKZGIXwJ35fT9yuUY0PldgJspaQsaWSV+SZzuSJCao2655WbvhG8 pDrTogwinVOoUnnDJVnIFg== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744711038; x= 1744797438; bh=0rhgTQ42jtsNwOZPEo1u1J4tYBhgJca0C9fLoG7I2J4=; b=M COt7HyMlibPKrsHCTNuLTwLAb6YVGqyGC6f402pRY4w+wMudUN4kxzC8yaHD9qNV /4u2+0dovRaxLso3jf4xydgrW1rp/IDu+ZXCS1jEQr9eY4R3Vy+wQKk+PqkK+S4P 3hQ41BHNyJLebo8pb2mGBLAt9KGpzZNAwXK35+Dw0rSu9AHZfAveff/lUc/mzUKj 3ENRmhhk/9enSnqCI0yZo9telz7/wJDgoPw69mAvhE0n3TCjZ6iizV2scXOsw34J +3TJARATroWLhRiaod+vhuAk9QsILndyrVkAXT4w/dB1XdxBBYDeiwJ4F1Cp8RY/ uOkzJYNli1XtYl7XxGFVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdefudejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtjeertder tdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhksh drihhmqeenucggtffrrghtthgvrhhnpeffueeiudejvdekheeuvdekfeffiedvueelteek udehjeetkeegvddugfdtgfeileenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehjohhhrghnnhgvshdrshgthhhinhguvghlih hnsehgmhigrdguvgdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Apr 2025 05:57:17 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 86029e98 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 15 Apr 2025 09:57:16 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 15 Apr 2025 11:57:10 +0200 Subject: [PATCH 3/4] Documentation: stop depending on Perl to massage user manual Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250415-b4-pks-drop-perl-v1-3-c6addf175858@pks.im> References: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> In-Reply-To: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> To: git@vger.kernel.org Cc: Johannes Schindelin X-Mailer: b4 0.14.2 The "fix-texi.perl" script is used to fix up the output of `docbook2x-texi`: - It changes the filename to be "git.info". - It changes the directory category and entry. The script is written in Perl, but it can be rather trivially converted to a shell script. Do so to remove the dependency on Perl for building the user manual. Signed-off-by: Patrick Steinhardt --- Documentation/Makefile | 4 ++-- Documentation/fix-texi.perl | 15 --------------- Documentation/fix-texi.sh | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 0d3a2c6bfe6..6485d40f620 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -398,9 +398,9 @@ user-manual.html: user-manual.xml $(XSLT) git.info: user-manual.texi $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi -user-manual.texi: user-manual.xml +user-manual.texi: user-manual.xml fix-texi.sh $(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@+ && \ - $(PERL_PATH) fix-texi.perl <$@+ >$@ && \ + $(SHELL_PATH) fix-texi.sh <$@+ >$@ && \ $(RM) $@+ user-manual.pdf: user-manual.xml diff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl deleted file mode 100755 index ff7d78f620a..00000000000 --- a/Documentation/fix-texi.perl +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/perl -w - -while (<>) { - if (/^\@setfilename/) { - $_ = "\@setfilename git.info\n"; - } elsif (/^\@direntry/) { - print '@dircategory Development -@direntry -* Git: (git). A fast distributed revision control system -@end direntry -'; } - unless (/^\@direntry/../^\@end direntry/) { - print; - } -} diff --git a/Documentation/fix-texi.sh b/Documentation/fix-texi.sh new file mode 100755 index 00000000000..bc300f7b0f1 --- /dev/null +++ b/Documentation/fix-texi.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +awk ' + /^@setfilename/{ + print "@setfilename git.info" + next + } + /^@direntry/{ + direntry=1 + print "@dircategory Development" + print "@direntry" + print "* Git: (git). A fast distributed revision control system" + print "@end direntry" + next + } + /^@end direntry/{ + direntry=0 + next + } + !direntry +' From patchwork Tue Apr 15 09:57:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 14051841 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6368228DF0F for ; Tue, 15 Apr 2025 09:57:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711042; cv=none; b=fceBRNHUwskOZBQtVauhHLQ5W5RQuVnldFYM1CJD5uCm6TK98/dQgbipK6hGw5Ggh3AfGinbnO9Yi1vbBDilidLyHB+jgOCv3/kEIhhWtcaVV9ARUnKeXgHAGlL9fpA7AQ7SkYbklehd19ekcF6qWq20khmKZpJ1UyWHJLoP9zE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744711042; c=relaxed/simple; bh=89MriEdT0X3Wo1XXNUywHxWoPwueXhm9YaIe3g+j27w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=av+9CbctdmQHpnYiVhGnIeWCTbLpt5NzRKAkMvpsK7WDplQfXqFrdGOAwHZIR9ehSUVv7Kktqkig/WaXiAIeo3oGFU0mTTns93F31Vx+9arZScsJ8mHyj251ijQ0oxnfJp6utHlA3dy0r8x0qBzXEnyxN9klCdgxy37sbSOUC+c= 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=QtomX2ql; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Cq4zkM1X; arc=none smtp.client-ip=202.12.124.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="QtomX2ql"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Cq4zkM1X" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id 7180D11402D5; Tue, 15 Apr 2025 05:57:19 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Tue, 15 Apr 2025 05:57:19 -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=1744711039; x=1744797439; bh=fMH9D9rGQyec0PwX4FopMbYFrXZjiR1hhIc47VL4ghs=; b= QtomX2qlso+beSbe79bMLJjR1AW6MbuW8llPOkUygJvgdGcg6D4TqY/AWfR233IS 8+m1+mkdrleT3LTJC6KeemLvOANdBxoCCsK1QMr3N+B3pb2T5Bvl5qgANGFM4tV6 eS07XD/YXC6crATxtHZVC8tlII5/Y4ZfMoJtaIW8lQYFlfo6XH3EO/Nj5neLfyDg qCUexj3ZcCzhbOW5MBBDrLR8E/CK97HPnloslxrICSKF05b2eSEkztG3kMgoi7Vv YqLK8IA+few6Ry0j+ALwlHAA/GR46KlzRI5cMMx8eBfMwa1qiVRduqK3eWUYoPgi fxPkZBCDAsSF61UU8ang9g== 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-sender:x-me-sender:x-sasl-enc; s=fm2; t=1744711039; x= 1744797439; bh=fMH9D9rGQyec0PwX4FopMbYFrXZjiR1hhIc47VL4ghs=; b=C q4zkM1XOxn21LXh5EBX0uU4Blf9HSx8XlXRT9JPyhFaC9F7avwU6Nm7G63oXbj2d 4Y/dbtKwAARgnu/uAP8Jw5iHW8kFIMtuAjSDEJbA5BZpILHTOZk4Ca2toZ9YTDf0 HcSzspSEg9b/jB+CjjUGoiW1VvOSnfba/VLlMt4vCXIC/2mPsVNuIXd1vEeJd+Vq FnYPLoLg4v1qhM6Zi7igt6lKQbVifvvzq7usVkgxRtvEsEyj3HL60IpR0ebGliZW kHR73i6AnAA29lepTKjqEMcSwqvxcqo+M1/6QmHbovr1/Ilm8+72vYyiCiKLinGT e/uI0wOU18cKCtPMzf8VA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddvvdefudekucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhephfffufggtgfgkfhfjgfvvefosehtkeertder tdejnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshesphhksh drihhmqeenucggtffrrghtthgvrhhnpeefhfeugeelheefjeektdffhedvhfdvteefgfdt udffudevveetgeeuuedtkefhgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehpshesphhkshdrihhmpdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopehjohhhrghnnhgvshdrshgthhhinhguvghlih hnsehgmhigrdguvgdprhgtphhtthhopehgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 15 Apr 2025 05:57:18 -0400 (EDT) Received: by vm-mail (OpenSMTPD) with ESMTPSA id 28bfca15 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 15 Apr 2025 09:57:17 +0000 (UTC) From: Patrick Steinhardt Date: Tue, 15 Apr 2025 11:57:11 +0200 Subject: [PATCH 4/4] Documentation: stop depending on Perl to generate command list Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250415-b4-pks-drop-perl-v1-4-c6addf175858@pks.im> References: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> In-Reply-To: <20250415-b4-pks-drop-perl-v1-0-c6addf175858@pks.im> To: git@vger.kernel.org Cc: Johannes Schindelin X-Mailer: b4 0.14.2 The "cmd-list.perl" script is used to extract the list of commands part of a specific category and extracts the description of each command from its respective manpage. The generated output is then included in git(1) to list all Git commands. The script is written in Perl. Refactor it to use shell scripting exclusively so that we can get rid of the mandatory dependency on Perl to build our documentation. The converted script is slower compared to its Perl implementation. But by being careful and not spawning external commands in `format_one ()` we can mitigate the performance hit to a reasonable level: Benchmark 1: Perl Time (mean ± σ): 10.3 ms ± 0.2 ms [User: 7.0 ms, System: 3.3 ms] Range (min … max): 10.0 ms … 11.1 ms 200 runs Benchmark 2: Shell Time (mean ± σ): 74.4 ms ± 0.4 ms [User: 48.6 ms, System: 24.7 ms] Range (min … max): 73.1 ms … 75.5 ms 200 runs Summary Perl ran 7.23 ± 0.13 times faster than Shell While a sevenfold slowdown is significant, the benefit of not requiring Perl for a fully-functioning Git installation outweighs waiting a couple of milliseconds longer during the build process. Signed-off-by: Patrick Steinhardt --- Documentation/Makefile | 4 +- Documentation/cmd-list.perl | 80 ---------------------------------- Documentation/cmd-list.sh | 104 ++++++++++++++++++++++++++++++++++++++++++++ Documentation/meson.build | 4 +- meson.build | 2 +- 5 files changed, 109 insertions(+), 85 deletions(-) diff --git a/Documentation/Makefile b/Documentation/Makefile index 6485d40f620..b109d25e9c8 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -317,8 +317,8 @@ cmds_txt = cmds-ancillaryinterrogators.adoc \ $(cmds_txt): cmd-list.made -cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT) - $(QUIET_GEN)$(PERL_PATH) ./cmd-list.perl .. . $(cmds_txt) && \ +cmd-list.made: cmd-list.sh ../command-list.txt $(MAN1_TXT) + $(QUIET_GEN)$(SHELL_PATH) ./cmd-list.sh .. . $(cmds_txt) && \ date >$@ mergetools-%.adoc: generate-mergetool-list.sh ../git-mergetool--lib.sh $(wildcard ../mergetools/*) diff --git a/Documentation/cmd-list.perl b/Documentation/cmd-list.perl deleted file mode 100755 index 0a0c1b3f611..00000000000 --- a/Documentation/cmd-list.perl +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -w - -use File::Compare qw(compare); - -sub format_one { - my ($source_dir, $out, $nameattr) = @_; - my ($name, $attr) = @$nameattr; - my ($path) = "$source_dir/Documentation/$name.adoc"; - my ($state, $description); - my $mansection; - $state = 0; - open I, '<', "$path" or die "No such file $path.adoc"; - while () { - if (/^(?:git|scalar)[a-z0-9-]*\(([0-9])\)$/) { - $mansection = $1; - next; - } - if (/^NAME$/) { - $state = 1; - next; - } - if ($state == 1 && /^----$/) { - $state = 2; - next; - } - next if ($state != 2); - chomp; - $description = $_; - last; - } - close I; - if (!defined $description) { - die "No description found in $path.adoc"; - } - if (my ($verify_name, $text) = ($description =~ /^($name) - (.*)/)) { - print $out "linkgit:$name\[$mansection\]::\n\t"; - if ($attr =~ / deprecated /) { - print $out "(deprecated) "; - } - print $out "$text.\n\n"; - } - else { - die "Description does not match $name: $description"; - } -} - -my ($source_dir, $build_dir, @categories) = @ARGV; - -open IN, "<$source_dir/command-list.txt"; -while () { - last if /^### command list/; -} - -my %cmds = (); -for (sort ) { - next if /^#/; - - chomp; - my ($name, $cat, $attr) = /^(\S+)\s+(.*?)(?:\s+(.*))?$/; - $attr = '' unless defined $attr; - push @{$cmds{$cat}}, [$name, " $attr "]; -} -close IN; - -for my $out (@categories) { - my ($cat) = $out =~ /^cmds-(.*)\.adoc$/; - my ($path) = "$build_dir/$out"; - open O, '>', "$path+" or die "Cannot open output file $out+"; - for (@{$cmds{$cat}}) { - format_one($source_dir, \*O, $_); - } - close O; - - if (-f "$path" && compare("$path", "$path+") == 0) { - unlink "$path+"; - } - else { - rename "$path+", "$path"; - } -} diff --git a/Documentation/cmd-list.sh b/Documentation/cmd-list.sh new file mode 100755 index 00000000000..fa90781f3c7 --- /dev/null +++ b/Documentation/cmd-list.sh @@ -0,0 +1,104 @@ +#!/bin/sh + +set -e + +format_one () { + source_dir="$1" + command="$2" + attributes="$3" + + path="$source_dir/Documentation/$command.adoc" + if ! test -f "$path" + then + echo >&2 "No such file $path" + exit 1 + fi + + state=0 + while read line + do + case "$state" in + 0) + case "$line" in + git*\(*\)|scalar*\(*\)) + mansection="${line##*\(}" + mansection="${mansection%\)}" + ;; + NAME) + state=1;; + esac + ;; + 1) + if test "$line" = "----" + then + state=2 + fi + ;; + 2) + description="$line" + break + ;; + esac + done <"$path" + + if test -z "$mansection" + then + echo "No man section found in $path" >&2 + exit 1 + fi + + if test -z "$description" + then + echo >&2 "No description found in $path" + exit 1 + fi + + case "$description" in + "$command - "*) + text="${description#$command - }" + + printf "linkgit:%s[%s]::\n\t" "$command" "$mansection" + case "$attributes" in + *" deprecated "*) + printf "(deprecated) " + ;; + esac + printf "$text.\n\n" + ;; + *) + echo >&2 "Description does not match $command: $description" + exit 1 + ;; + esac +} + +source_dir="$1" +build_dir="$2" +shift 2 + +for out in "$@" +do + category="${out#cmds-}" + category="${category%.adoc}" + path="$build_dir/$out" + + while read command command_category attributes + do + case "$command" in + "#"*) + continue;; + esac + + case "$command_category" in + "$category") + format_one "$source_dir" "$command" " $attributes ";; + esac + done <"$source_dir/command-list.txt" >"$build_dir/$out+" + + if cmp "$build_dir/$out+" "$build_dir/$out" >/dev/null 2>&1 + then + rm "$build_dir/$out+" + else + mv "$build_dir/$out+" "$build_dir/$out" + fi +done diff --git a/Documentation/meson.build b/Documentation/meson.build index 8b9e692c599..b731c76e9e7 100644 --- a/Documentation/meson.build +++ b/Documentation/meson.build @@ -315,12 +315,12 @@ cmd_lists = [ documentation_deps += custom_target( command: [ - perl, + shell, '@INPUT@', meson.project_source_root(), meson.current_build_dir(), ] + cmd_lists, - input: 'cmd-list.perl', + input: 'cmd-list.sh', output: cmd_lists ) diff --git a/meson.build b/meson.build index 8bab8f3481f..97753d2cfa7 100644 --- a/meson.build +++ b/meson.build @@ -779,7 +779,7 @@ endif # features. It is optional if you want to neither execute tests nor use any of # these optional features. perl_required = get_option('perl') -if get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') or get_option('docs') != [] +if get_option('gitweb').enabled() or 'netrc' in get_option('credential_helpers') perl_required = true endif