Subject: [bug#51307] [PATCH v2 0/3] scripts: hash: Several files and serializer.

From: zimoun <[email-masked]>
Date: Wed, 15 Dec 2021 09:06:09 +0100

Hi,

What do you think about patch#51307 [1] for “guix hash”?

As explained and discussed earlier in this thread, it renames the option
’-r’ to ’-S nar’ – keeping the old one for backward compatibility* – and
adds ’-S git’.

1: <http://issues.guix.gnu.org/issue/51307>

*backward compatibility: we can come later with a plan to remove and/or
 deprecate.

On Thu, 18 Nov 2021 at 01:20, zimoun <[email-masked]> wrote:

> The first patch is the one which already made consensus.  Minor suggestions by
> [1] has been added.
>
> The 2 following ones add UI presented there [2].  Basically, it allows:
>
>     guix hash foo        # similar as -S none
>     guix hash foo -S nar # similar as -r
>     guix hash foo -S git
>
> Especially, compare:
>
>         $ cat /tmp/foo.txt | git hash-object --stdin
>         557db03de997c86a4a028e1ebd3a1ceb225be238
>         $ ./pre-inst-env guix hash -S git -H sha1 -f hex /tmp/foo.txt
>         557db03de997c86a4a028e1ebd3a1ceb225be238
>
>
> Two remarks:
>
>  1. « #:use-module (disarchive) » is added.  Elsewhere (guix download), the
>     module is "conditionally" loaded, as if disarchive is an optional
>     dependency.  What should be done?
>
>  2. The SWH serializer is not added yet.
>
>
> Cheers,
> simon
>
> 1: <http://issues.guix.gnu.org/issue/51307#3>
> 2: <http://issues.guix.gnu.org/issue/51307#12>
>
> zimoun (3):
>   scripts: hash: Support several files.
>   scripts: hash: Add 'serializer' option.
>   scripts: hash: Add git serializer.
>
>  doc/guix.texi         |  27 +++++++----
>  guix/scripts/hash.scm | 108 ++++++++++++++++++++++++++++++------------
>  tests/guix-hash.sh    |  20 ++++++--
>  3 files changed, 112 insertions(+), 43 deletions(-)
>
>
> base-commit: 99084abd80d7c81e83263ffc6fd3699aeb8899c5

Cheers,
simon