GNU bug report logs -
#50072
[PATCH WIP 0/4] Add upstream updater for git-fetch origins.
Previous Next
Reported by: Sarah Morgensen <iskarian <at> mgsn.dev>
Date: Sun, 15 Aug 2021 23:17:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
zimoun schreef op di 04-01-2022 om 23:22 [+0100]:
> 2) ’auto’ is confusing…
>
> > + (select? (negate vcs-file?)))
> > + "Compute the hash of FILE with ALGORITHM. If RECURSIVE? is #true or 'auto',
> > +recurse into subdirectories of FILE, computing the combined hash (nar hash) of
>
> …here I understand that ’auto’ means #true…
Precisely, in the sense 'auto' means #true in that 'auto' recurses.
But sometimes #true / auto compute a different hash ...
> > +Keep in mind that the hash of a regular file depends on RECURSIVE?:
> > +if the recursive hash is desired, it must be set to #true. Otherwise, it must
> > +be set to #false or 'auto'. In most situations, the non-recursive hash is desired
> > +for regular files."
>
> …but there it is the contrary. :-)
No, when #:recursive? is 'auto' and the file is a directory, it
recurses. When it is 'auto' and the file is a regular file, then
it also recurses, albeit in a trivial way (because regular files don't
contain other files).
This comment explains that the 'recursive hash' (nar hash) and 'regular
hash' of a regular file are different, that usually you want the
regular hash for regular files, and implies that '#:recursive? auto'
usually does the right thing.
But if you really want the recursive hash for regular files, then you
can still compute that by setting #:recursive? #true.
> To me, #true/#false or #t/#f are
> meaningful, especially when…
>
> > + (if (or (eq? recursive? #true)
> > + (and (eq? recursive? 'auto)
>
> …the symbol ’auto’ is only used here. IIRC all the series. :-)
In ‘[PATCH v4 3/4] refresh: Support non-tarball sources.’, there's
> + (let ((hash (file-hash* output)))
There, #:recursive? is 'auto'.
Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 132 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.