Hi Timothy,

On Tue, 04 Jan 2022 at 14:09, Timothy Sample <samp...@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

>From 6cc3b3b93912041112570d840f86f8c52467d316 Mon Sep 17 00:00:00 2001
From: zimoun <zimon.touto...@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)))
 
 
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

Reply via email to