From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EDmXEJWH1WF/egAAgWs5BA (envelope-from ) for ; Wed, 05 Jan 2022 12:57:09 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wAhqCZWH1WFaBwEAG6o9tA (envelope-from ) for ; Wed, 05 Jan 2022 12:57:09 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CD378217E2 for ; Wed, 5 Jan 2022 12:57:08 +0100 (CET) Received: from localhost ([::1]:49718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n54uh-0004C1-Qq for larch@yhetil.org; Wed, 05 Jan 2022 06:57:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n54uc-0004Bd-Ao for guix-patches@gnu.org; Wed, 05 Jan 2022 06:57:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n54uc-0000nd-1W for guix-patches@gnu.org; Wed, 05 Jan 2022 06:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n54ub-0007HW-L9 for guix-patches@gnu.org; Wed, 05 Jan 2022 06:57:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH WIP 0/4] Add upstream updater for git-fetch origins. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 Jan 2022 11:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: Sarah Morgensen , 50072@debbugs.gnu.org Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164138379927963 (code B ref 50072); Wed, 05 Jan 2022 11:57:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 11:56:39 +0000 Received: from localhost ([127.0.0.1]:39690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n54uE-0007Gx-UY for submit@debbugs.gnu.org; Wed, 05 Jan 2022 06:56:39 -0500 Received: from mail-wm1-f53.google.com ([209.85.128.53]:42666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n54uC-0007Gh-QC for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 06:56:37 -0500 Received: by mail-wm1-f53.google.com with SMTP id a83-20020a1c9856000000b00344731e044bso3164380wme.1 for <50072@debbugs.gnu.org>; Wed, 05 Jan 2022 03:56:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=WyGDE8n7XBRmViwvCaeiAYJxFqVyJpYkjCgm0a9XYX0=; b=VDLaBQTUzPTsb5kCFhFzqLrD3J3lehNJd5o3epp9t6oELmwkslU2qIPXhnSE1j8XKN nAl6agE8rz9N4Ko2Ut9EThjv7gAIumdvah0FpMrv1r/mVYQzaacs1DnJqNXubuCXxnOA 7ukyK/Cgpd5vJM2TH2Ns5ltgdXsnTgyWKRL20oz7tFIF+HU42SBwVsWOsx0l2NF988LZ yrUtLWcgwt/RNVW64VUzH5tUG8Jos9DUbQbw0NfeDe8gPgV6xnR+y96UZsDbBD/s4sg+ 80g6g6L8eo72B5FhURUQL90IRt6MEWTRRXWZUb8IB6OJGNY4F7+fsDHBJ7h29Vkbffnj dOZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=WyGDE8n7XBRmViwvCaeiAYJxFqVyJpYkjCgm0a9XYX0=; b=5Txt0g3kYKz9w8E5lOZQyW4J22u8lMUgT0eIuaF+KqPj/wix8J0aL7zPPswB4S3rFR J7EKrbj26iz0ggK3/vpZp5LlOZ/v7r5xYjViV8ru9ast8uFCc4DiNzbenEKvsPri3FzW ajNJMCm0sSE+XJBidFqFKrtRTWqZPsB450fg+/4n4gjlXFgUyIGI8nKmBajNQztDUYle 953qF3QhMRZI49Twm/fIMnUDSnQcjhdV5WM/caCU+S1MJV3UCzY9Ai1cJWzdwgaJpDaP Jzt/VvuIH3oGqIIJYu5sV9rW9O5KwbY19O23z8uiYq2iTPxFIhbbXKrfjvp4dMC3GH6v IyCQ== X-Gm-Message-State: AOAM532bdDFJsMSR4aC2kjGXVd++dpqxlenXjWxLICgYbm/MnFYreI6b FP6fDdEj54qxXq7FNLvcLtA= X-Google-Smtp-Source: ABdhPJxeSgh+f5gk19glN96Ao7iObftAH8qzxXvBcJZGYTM03GBkYs6y+oBUoNg2mdkyNob3kGT0vw== X-Received: by 2002:a05:600c:190b:: with SMTP id j11mr2482413wmq.182.1641383790827; Wed, 05 Jan 2022 03:56:30 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id t12sm47126932wrs.72.2022.01.05.03.56.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 03:56:30 -0800 (PST) From: zimoun In-Reply-To: <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> Date: Wed, 05 Jan 2022 12:48:48 +0100 Message-ID: <86y23u768v.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641383828; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WyGDE8n7XBRmViwvCaeiAYJxFqVyJpYkjCgm0a9XYX0=; b=p5MOoojgtbWSJ+dMb4fGJxc/PU6jgOqADKiPTR5TlzZXqZfeMUxNS9JttR45GuNiPJ9Y7/ WBQ7W7obMNn5PTqW54fSI02UaDSNVZ67+OPQwPNUpTI9QKWIEV5pCwO3yRytwhwMPg1LJ6 pkyD70Yimf65Nrjadyx3AsM5nfLpk0Mn+Vz+ZtFmzGrP6MExMVpYNADFMftKXWM7lM+wv9 EZFpCV8LOBt5RLgxO47RsNmE6FrymM2pqQRnLzR0td8gUlN7L2yCkA6oxlp6z99CWO8+6j 5qaTn3NDENDciU5ULdtXL+bQItY4qgyq7V25IzgbOoBPV0TsIMehUCQfWv0r8w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641383828; a=rsa-sha256; cv=none; b=AOQaq5uediSVcVgRyAiibBeCUBoLx7f3pRdtn2W0vVyh78ARuNtGYtYWEH+UpXlZBCJybK UWXvrsU246cpB1AlUGyrZtNFK84BfFRWe+MKiwhRN6JtDYTqTxl8adlMnYHr6LcUmP/at1 AjtaQDqOMVkAZrHTiXYgq1WqZmznmfDWQNkX+OtJklogajkI1QL3x7lTPCqzScsIL4DHZM 8rfo138Lw5IJReP19vEQ5YCQF37N+3F22XfF3bXAH9B0iJpF+w3cB8PTfwXEjarpWVWT6N +JcIs+SxtBVxagvdaQdmI29Ly1iFNAEzOdJpqTGmwxP9vMnCWTgBfygfpnRvJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VDLaBQTU; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=VDLaBQTU; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: CD378217E2 X-Spam-Score: -3.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: 5e8vSq0qEwNx Hi Maxime, On Wed, 05 Jan 2022 at 11:07, Maxime Devos wrote: > Precisely, in the sense 'auto' means #true in that 'auto' recurses. > But sometimes #true / auto compute a different hash ... [...] > No, when #:recursive? is 'auto' and the file is a directory, it > recurses. When it is 'auto' and the file is a regular file, then > it also recurses, albeit in a trivial way (because regular files don't > contain other files). > > This comment explains that the 'recursive hash' (nar hash) and 'regular > hash' of a regular file are different, that usually you want the > regular hash for regular files, and implies that '#:recursive? auto' > usually does the right thing. > > But if you really want the recursive hash for regular files, then you > can still compute that by setting #:recursive? #true. Thanks for explaining. Hm, my confusion is probably the same as #51307 [1]. 1: Well, I think =E2=80=99#:recursive?=E2=80=99 is confusing, and =E2=80=99aut= o=E2=80=99 too because it is not POLA for a plumbing function, IMHO. Anyway. It is v4 and it is ready to merge. :-) I just propose to replace =E2=80=99#:recursive?=E2=80=99 by =E2=80=99#:nar-= serializer?=E2=80=99 and a docstring along these lines, --8<---------------cut here---------------start------------->8--- "Compute the hash of FILE with ALGORITHM. If NAR-SERIALIZER? is #true, compute the combined hash (NAR hash) of FILE for which (SELECT? FILE STAT) returns true. If NAR-SERIALIZER? is #false, compute the regular hash using the default serializer. It is meant to be used for a regular file. If NAR-SERIALIZER? is 'auto', when FILE is a directory, compute the combined hash (NAR hash). When FILE is a regular file, compute the regular hash using the default serializer. The option =E2=80=99auto=E2= =80=99 is meant to apply by default the expected hash computation. Symbolic links are not dereferenced unless NAR-SERIALIZER? is false. This procedure must only be used under controlled circumstances; the detection of symbolic links in FILE is racy. --8<---------------cut here---------------end--------------->8--- WDYT? >> > +=C2=A0 (if (or (eq? recursive? #true) >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (and (eq? recu= rsive? 'auto) >>=20 >> =E2=80=A6the symbol =E2=80=99auto=E2=80=99 is only used here.=C2=A0 IIRC= all the series. :-) > > In =E2=80=98[PATCH v4 3/4] refresh: Support non-tarball sources.=E2=80=99= , there's > >> + (let ((hash (file-hash* output))) > > There, #:recursive? is 'auto'. Naive questions: Is it mandatory? Or can be explicitly set? (I have nothing against, just to me =E2=80=99auto=E2=80=99 is somehow ambig= uous and =C2=ABIn the face of ambiguity, refuse the temptation to guess=C2=BB as =E2=80=99pyh= on3 -c 'import this'=E2=80=99 says ;-)) Cheers, simon