unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Timothy Sample <samplet@ngyro.com>
Cc: Mortimer Cladwell <mbcladwell@gmail.com>, help-guix <help-guix@gnu.org>
Subject: Re: How to use guix hash --serializer?
Date: Tue, 04 Jan 2022 21:54:43 +0100	[thread overview]
Message-ID: <86h7ajcjcc.fsf@gmail.com> (raw)
In-Reply-To: <87k0ff1foz.fsf@ngyro.com>

[-- Attachment #1: Type: text/plain, Size: 404 bytes --]

Hi Timothy,

On Tue, 04 Jan 2022 at 14:09, Timothy Sample <samplet@ngyro.com> wrote:

> I’m pretty sure it’s a bug.  Fortunately, with Disarchive 0.4.0, the
> following (untested) patch should fix it:

Yep!  The tests require a minor adjustment adjusted too.  See attached
patch.

Feel free to adjust with your commit name and push. :-)
(I do not have commit rights.)

Cheers,
simon


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix.patch --]
[-- Type: text/x-diff, Size: 2109 bytes --]

From 6cc3b3b93912041112570d840f86f8c52467d316 Mon Sep 17 00:00:00 2001
From: zimoun <zimon.toutoune@gmail.com>
Date: Tue, 4 Jan 2022 21:47:15 +0100
Subject: [PATCH] guix hash: Allow '--exclude-vcs' option using 'git'
 serializer.

* guix/scripts/hash.scm (git-hash): Use '#:select?' with
'git-hash-directory'.
* tests/guix-hash.sh: Adjust accordingly.
---
 guix/scripts/hash.scm | 2 +-
 tests/guix-hash.sh    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm
index d73e3d13dd..c44a4de9a4 100644
--- a/guix/scripts/hash.scm
+++ b/guix/scripts/hash.scm
@@ -69,7 +69,7 @@ (define directory?
       ((directory) #t)
       (else #f)))
   (if directory?
-      (git-hash-directory file algorithm)
+      (git-hash-directory file algorithm #:select? select?)
       (git-hash-file file algorithm)))
 
 \f
diff --git a/tests/guix-hash.sh b/tests/guix-hash.sh
index 854c493514..8b03c7985d 100644
--- a/tests/guix-hash.sh
+++ b/tests/guix-hash.sh
@@ -53,6 +53,7 @@ mkdir "$tmpdir/subdir"
 
 test `guix hash -S nar "$tmpdir"` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
 test `guix hash -S nar "$tmpdir" -H sha512` = 301ra58c2vahczzxiyfin41mpyb0ljh4dh9zn3ijvwviaw1j40sfzw5skh9x945da88n3785ggifzig7acd6k72h0mpsc20m1f66m9n
+test `guix hash -S git "$tmpdir"` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk
 test `guix hash -S git "$tmpdir" -H sha512` = 158b10d1bsdk4pm8ym9cg9ckfak1b0cgpw7365cl6s341ir380mh2f4ylicyh8khyrfnwq5cn9766d7m8fbfwwl94ndkv456v6a8knr
 
 # Deprecated --recursive option
@@ -76,7 +77,7 @@ test `guix hash -S git $tmpdir` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8
 
 # ...but remains the same when using `-x'
 test `guix hash -S nar $tmpdir -x` = 10k1lw41wyrjf9mxydi0is5nkpynlsvgslinics4ppir13g7d74p
-test `guix hash -S git $tmpdir -x` = 0ghlpca9xaswa1ay1g55dknwd9q899mi3ahfr43pq083v8wisjc7
+test `guix hash -S git $tmpdir -x` = 1m9yxz99g7askm88h6hzyv4g2bfv57rp5wvwp3iq5ypsplq1xkkk
 
 # Without '-r', this should fail.
 ! guix hash "$tmpdir"

base-commit: 4c812db049d5c9f2c438748e180f9486ad221b0a
-- 
2.32.0


  parent reply	other threads:[~2022-01-04 20:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 16:32 How to use guix hash --serializer? Mortimer Cladwell
2022-01-04 16:53 ` zimoun
2022-01-04 19:09   ` Timothy Sample
2022-01-04 19:48     ` Mortimer Cladwell
2022-01-04 19:57       ` Tobias Geerinckx-Rice
2022-01-04 19:58       ` Mortimer Cladwell
2022-01-04 20:17       ` zimoun
2022-01-04 20:44         ` Mortimer Cladwell
2022-01-04 20:57           ` Tobias Geerinckx-Rice
2022-01-04 21:02           ` zimoun
2022-01-04 21:16             ` Mortimer Cladwell
2022-01-04 20:54     ` zimoun [this message]
2022-01-05  1:44       ` Timothy Sample
2022-01-05  7:43         ` zimoun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86h7ajcjcc.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=mbcladwell@gmail.com \
    --cc=samplet@ngyro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).