From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 17 19:36:01 2021 Received: (at 51307) by debbugs.gnu.org; 18 Nov 2021 00:36:01 +0000 Received: from localhost ([127.0.0.1]:34151 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnVPE-0007V6-Ml for submit@debbugs.gnu.org; Wed, 17 Nov 2021 19:36:00 -0500 Received: from mail-wr1-f42.google.com ([209.85.221.42]:34340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mnVPA-0007Uj-FR for 51307@debbugs.gnu.org; Wed, 17 Nov 2021 19:35:59 -0500 Received: by mail-wr1-f42.google.com with SMTP id d5so8051494wrc.1 for <51307@debbugs.gnu.org>; Wed, 17 Nov 2021 16:35:56 -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=XrLikOrOltmKYFTGn2ifLyEUjrljqnpnwHcI6f7B1vs=; b=PIobW36jRgLrCx/qXLb+SRUsgloqZlXcK2YhQuBQIdkNcAUsxq1t0kr+i9EBx5ysDA BWElHgtzFMArmVc1s92IodWRUMcbkOl/9LS+GYDT2weAjVROao35aRxsmK+O+U9pxVPd nyhZJYmvnVFYQRCmWqY07pIc1qR06qCfYxgeUN7bw7tA2sHeuU+XoRBTHZs49D6n1AoL irLFBtOiwP4BgHasJaukDIQ0wVDvAN4ZME8m2inF5xz2Lo8+00GJF6Q9nDN4KdIbEWIC y691yfDMe1vofqnE54qNEUsmIYq/zMe+EgMlSR1zmoMub/EMgl/8b+UtUf09bHRhF+rC I94Q== 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=XrLikOrOltmKYFTGn2ifLyEUjrljqnpnwHcI6f7B1vs=; b=lKoTb8LEXOOwu8OnSkk/9e1S5ELPP7IaFaio0jP8kgwZ3QkPJ2pdanmoO2vaukAa/A 0JJ28HxNThviX/AU27+bg0+A5v7X3qKAKH0jrn9uGmqioGUyNCz+SfWJ7U64ewG6Qzuc qZNK3YYY3X56zwlGotWVazgKutg3JN2/tTnR0mkfFKC9pcugb9wPNq3LL5JL1wjhL4V5 Hcg8xLo45n4wmXaGfLQvZ9MfnkxCBMZQQLQbQjBrr3FkmCqJYhfNfDoNZBb6k1dx08aL +nHI6GiBVslW4H+lKG19X5txh/rJgDeaGrtYpWk7U4+ljjh3YbiNUh06N8Ijo6QmVxBn Yxog== X-Gm-Message-State: AOAM532VYGuvD2VSr58by3vraCnL49u51ybAxlHHc7lkziJgZpDKefWH IZ2VIXn2W7RonBRXf0AcKGmJvVTve+4= X-Google-Smtp-Source: ABdhPJySXezOwBohriM+oM0+QbBEfC/N3jEG7uVvExOwjtDUv/ahWi8xS4VIzYW6PzPcOfw/mqm9Yw== X-Received: by 2002:a05:6000:1289:: with SMTP id f9mr26834296wrx.329.1637195750590; Wed, 17 Nov 2021 16:35:50 -0800 (PST) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id x4sm6828283wmi.3.2021.11.17.16.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Nov 2021 16:35:49 -0800 (PST) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: Content hashes and file tree serialization methods In-Reply-To: <87mtmpntcf.fsf_-_@gnu.org> References: <20211020165020.3358311-1-zimon.toutoune@gmail.com> <87wnlusgwy.fsf@gnu.org> <86tugyleub.fsf@gmail.com> <87mtmpntcf.fsf_-_@gnu.org> Date: Thu, 18 Nov 2021 01:29:27 +0100 Message-ID: <86wnl6qpaw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 51307 Cc: 51307@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Ludo, On Sun, 31 Oct 2021 at 15:48, Ludovic Court=C3=A8s wrote: > Thinking more about it, I think confusion stems from the term > =E2=80=9Crecursive=E2=80=9D (inherited from Nix) because, as you write, i= t doesn=E2=80=99t > necessarily have to do with recursion and directory traversal. > > Instead, it has to do with the serialization method. > > Thus, probably, =E2=80=98--recursive=E2=80=99 could be replaced by a =E2= =80=98-S=E2=80=99 flag: > > guix hash -S nar something > > or: > > guix hash -S none something > guix hash -S git something > guix hash -S swh something > > =E2=80=98-S none=E2=80=99 would be like not passing =E2=80=98-r=E2=80=99;= =E2=80=98-S git=E2=80=99 would serialize the > file/directory as a Git tree; =E2=80=98-S swh=E2=80=99 would serialize it= the SWH way, > which is like Git except it preserves empty directories (Disarchive > implements the Git/SWH methods already.) Well, v2 is an attempt for this UI. It does not solve my initial problem but it is a first step in that direction. ;-) Note that SWH serializer is not added. Because I have probably missed to reach the implementation. :-) Well, next step could be to add an option =E2=80=9C--list-serializers=E2=80= =9C. Let as an exercise for the reader. ;-) > As mentioned towards the end of > , > being able to deal with different tree serialization methods would be > useful going forward; for instance, if we had the option to store > SWH-style content hashes for origins, that=E2=80=99d help a lot. Allowin= g =E2=80=98guix > hash=E2=80=99 to deal with that is a first step in that direction. Well, this series does not add SWH-style but it is a tiny step in that direction. Somehow, after v2-patch#2, it is easy to add as many serializers as we want. :-) > (Apologies for slipping a bit off-topic=E2=80=A6) Thanks for slipping off-topic. :-) Cheers, simon *serializer: it is not an English word but I lacked imagination.