From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mGOcEhSX1WFP5gAAgWs5BA (envelope-from ) for ; Wed, 05 Jan 2022 14:03:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EHpCCxSX1WE5EQAAG6o9tA (envelope-from ) for ; Wed, 05 Jan 2022 14:03:16 +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 1CB7B340B8 for ; Wed, 5 Jan 2022 14:03:15 +0100 (CET) Received: from localhost ([::1]:46134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n55wf-00030B-TD for larch@yhetil.org; Wed, 05 Jan 2022 08:03:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n55wU-0002w4-8I for guix-patches@gnu.org; Wed, 05 Jan 2022 08:03:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56415) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n55wT-0005yG-Tc for guix-patches@gnu.org; Wed, 05 Jan 2022 08:03:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n55wT-0002o4-RB for guix-patches@gnu.org; Wed, 05 Jan 2022 08:03: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 13:03: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.164138775910754 (code B ref 50072); Wed, 05 Jan 2022 13:03:01 +0000 Received: (at 50072) by debbugs.gnu.org; 5 Jan 2022 13:02:39 +0000 Received: from localhost ([127.0.0.1]:39728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55w7-0002nN-5g for submit@debbugs.gnu.org; Wed, 05 Jan 2022 08:02:39 -0500 Received: from mail-wr1-f50.google.com ([209.85.221.50]:41603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n55w5-0002nA-8X for 50072@debbugs.gnu.org; Wed, 05 Jan 2022 08:02:37 -0500 Received: by mail-wr1-f50.google.com with SMTP id v6so21162799wra.8 for <50072@debbugs.gnu.org>; Wed, 05 Jan 2022 05:02:37 -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=aYLxx4bqQ98yW2V1aVq9857H9Wpcl9Kcoo29FHfDkFc=; b=GiD9XRBO1EqBOcFYa9jHADeJMn9nm41l1IndOYkOJsFMzYK7l/AHOOAGCeAePgvlpr oaA04TLfIhIn+pT4gP7vdE0ENDqcRVVuvwdPCtQkWoZgWWu1sFg9sOk+w2Wd2Dnv/rPs RZgXlSFFYvEv9XTJqOox2UeyoQSMWXSknZIY295gT79Bqx+fQV3Vdu/PlfM1xr3slS3Z Cvd02/X1+M34r/gx4JLAwXDd63O4s8xwsPmX24WPF2JJ0b1SvyftCQlBlO7AkpBz4c3f 3OwWJMbLBld0mgMyJIjhhkRWanhGxSDMwhmCF2LFtaVlbTpYIwD4m/stFqpXAx/FQfDT gXsQ== 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=aYLxx4bqQ98yW2V1aVq9857H9Wpcl9Kcoo29FHfDkFc=; b=7Pdt6x29Oy/0ytSPPuCJOeKJwggeGWmjlMBCFh3LoCmGf3HFitqihOdA9YsOtuRa6i Ry3mP4HQFKWI7orTExQrlOQQzFFM8l6hi58CtCFcHvLV1Xu8MjsYG0pploduX4Y71pLJ pCiBoKWbW6XFpf6CbUce7c4kPVcOVfkDAyBL77JgubO3QdeTGlmMUfhNY2A4Rvor4PMy rLMFHD4zAJOc+6Vfpj435ponh6qAmVKVGuCjvTCg9eoeAz94wWxU0HDp9bdTNlYrgbfo 0yIyAaWbnZ9w8h2dVBOYHdmv7f3E2rE7IjOxGighjU1vYPO6UwkHf3TvrO1wN7IYDcsc MiiQ== X-Gm-Message-State: AOAM5306AgIRhQxEub9Z6itZtUux0qLpaaXbnEZmoq9d5wZ6kSphsvZ6 LR09FdWKwhwJEX5gSbhVGuY= X-Google-Smtp-Source: ABdhPJyYVhLI5db5Ga+wf45cceBIilVjzoG6IisMR5a7xirbZcEKN9uWdMSLMU+eJqehgRUWvNeeGg== X-Received: by 2002:a5d:6108:: with SMTP id v8mr45679502wrt.661.1641387751236; Wed, 05 Jan 2022 05:02:31 -0800 (PST) Received: from lili ([88.126.110.68]) by smtp.gmail.com with ESMTPSA id z6sm3454996wmp.9.2022.01.05.05.02.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 05:02:30 -0800 (PST) From: zimoun In-Reply-To: References: <20220104200643.43374-1-maximedevos@telenet.be> <20220104200643.43374-2-maximedevos@telenet.be> <867dbfcf9n.fsf_-_@gmail.com> <52e7be94d926aa06c2a0132090e8c212381e7900.camel@telenet.be> <86y23u768v.fsf@gmail.com> Date: Wed, 05 Jan 2022 13:58:38 +0100 Message-ID: <86pmp6730h.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=1641387795; 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=aYLxx4bqQ98yW2V1aVq9857H9Wpcl9Kcoo29FHfDkFc=; b=i+SowAn+HaBrA/1L9DUQnW+JEpD8A0gol76ZMiSyqlpp+JY5v5aYQJb+FVfiRJg0HsoyIu +tykOmSlsQ/UDxRlkk3ajKJ27Ter1HQ6GeZo1BZiuiThiStQQ5hKvHT00XkgzZvflz5gci dvXzkHJiuEhGXMi2N6PA3pQ1yiy5Xy4GuRPeW+H0Tvnk+h+Ew7po0mfKLj9QYTtUs2A40g Pr6h7dKWl539XgL75a6dqzkS6tDeZ3w/CZet98bPB6A81EX3XTit2gp20bjpaYpbQ8Hduu Z0NBAyfX7gglI5PEzmDOJtEf+aD2qP/SJ8DDn7lZApVEghkz6f+Oh25T8DWHMQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641387795; a=rsa-sha256; cv=none; b=nJ9ZxKXlqEN90QWNTNtlEKzi1rL5bSZoP9BynCRThe1syHOchkQBgQlfsDJWFWzQ/5Yy/f iPbI3zflmhHur2dVKp760luDIDAddGlDyjbhuoif90uNpl9woDYxyDW23KpHRT3+3cyDBe CjVGUTLX7tskzGz9xB7knWZZMOtaZqSIggZuKRgS6UfcEiKR+lFUqoCRm77Uc06gTt8HOI PDJi6oyba2Ij1IoW4Yt6irsPOkVojGLv5wA79HQX3AckMQk15tBT2ojQIJ9AaH/yhhtNuT 3ou2c/UepKdAK0xFQeLem6V6zD/F1OaLKfwCnqLRRDuLiTTkw08yPBDNt6WJIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GiD9XRBO; 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.00 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=GiD9XRBO; 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: 1CB7B340B8 X-Spam-Score: -3.00 X-Migadu-Scanner: scn0.migadu.com X-TUID: gIYH6sAPLN0X Hi Maxime, On Wed, 05 Jan 2022 at 12:27, Maxime Devos wrote: > zimoun schreef op wo 05-01-2022 om 12:48 [+0100]: >> Well, I think =E2=80=99#:recursive?=E2=80=99 is confusing, and =E2=80=99= auto=E2=80=99 too because it is >> not POLA for a plumbing function, IMHO.=C2=A0 [...] > > Principle of least authority, or principle of least astonishment? > I presume the latter. Latter. :-) >> Anyway. It is v4 and it is ready to merge. :-) > > I vote for a purple bikeshed! But your orange bikeshed would also keep > the bikes out of the rain. :-) >> --8<---------------cut here---------------start------------->8--- >> =C2=A0 "Compute the hash of FILE with ALGORITHM.=C2=A0 If NAR-SERIALIZER= ? is >> =C2=A0 #true, compute the combined hash (NAR hash) of FILE for which (SE= LECT? >> =C2=A0 FILE STAT) returns true. >>=20 >> =C2=A0 If NAR-SERIALIZER? is #false, compute the regular hash using the >> =C2=A0 default serializer.=C2=A0 It is meant to be used for a regular fi= le. >>=20 >> =C2=A0 If NAR-SERIALIZER? is 'auto', when FILE is a directory, compute t= he >> =C2=A0 combined hash (NAR hash).=C2=A0 When FILE is a regular file, comp= ute the >> =C2=A0 regular hash using the default serializer.=C2=A0 The option =E2= =80=99auto=E2=80=99 is meant >> =C2=A0 to apply by default the expected hash computation. >>=20 >> =C2=A0 Symbolic links are not dereferenced unless NAR-SERIALIZER? is fal= se. >>=20 >> =C2=A0 This procedure must only be used under controlled circumstances; = the >> =C2=A0 detection of symbolic links in FILE is racy. >> --8<---------------cut here---------------end--------------->8--- > The nar hash / regular hash difference seems a very low-level detail to > me, that most (all?) users don't need to be bothered about. Except > maybe if FILE denotes an executable regular file, but file-hash* is > currently only used on tarballs/zip files/git checkouts, which aren't > executable files unless weirdness or some kind of attack is happening. > > I think that, the =E2=80=98least astonishing=E2=80=99 thing to do here, i= s computing > the hash that would go into the 'hash' / 'sha256' field of 'origin' > objects by default, and not the nar hash for regular files that's > almost never used. I do not understand what you mean here. =E2=80=99file-hash*=E2=80=99 is a = low-level detail, no? Whatever. :-) Well, I am sorry if my 3 naive comments are not convenient. Just, to be sure, I am proposing: 1) It is v4 and ready, I guess. About =E2=80=99auto=E2=80=99, I could hav= e waken up earlier. :-) And it can be still improved later as you are saying in the other answer. So, we are done, right? 2) From my point of view, =E2=80=99#:recursive?=E2=80=99 needs to be adapt= ed in agreement with the discussion [1], quoting Ludo: Thinking more about it, I think confusion stems from the term =E2=80=9Crecursive=E2=80=9D (inherited from Nix) because, as you wr= ite, it doesn=E2=80=99t necessarily have to do with recursion and directory traversal. Instead, it has to do with the serialization method. 1: And I do not have a strong opinion. Just a naive remark. 3) Whatever the keyword for the current v4 =E2=80=99#:recursive?=E2=80=99 = is picked, I still find the current docstring wording unclear. In fact, reading the code is more helpful. :-) I am just proposing a reword which appears to me clearer than the current v4 one. Maybe, I am missing the obvious. Or maybe this proposed rewording is not clearer. :-) WDYT? Cheers, simon