Subject: Re: bug#57460: [PATCH 00/19] Refresh to specific version

From: Ludovic Courtès <[email-masked]>
Date: Sat, 24 Sep 2022 11:24:37 +0200

Hartmut Goebel <[email-masked]> skribis:

> * guix/import/git.scm
>   (latest-tag): Add keyword-argument 'version'. If version is given, try to
>   find the respective version tag.
>   (latest-git-tag-version): Add keyword-argument 'version' and pass it on to
>   called functions.
>   (latest-releease) Rename to (import-release), add keyword-argument 'version'
>   and pass it on to called functions.

(Same comment as before.)

> +(define* (latest-tag url
> +                     #:key prefix suffix delim pre-releases? (version #f))
>    "Return the latest version and corresponding tag available from the Git
>  repository at URL."

Please augment the docstring to explain the meaning of #:version.

> +      (let ((version-to-pick
> +             (if version
> +                 (filter (lambda (vt) (string=? version (car vt)))
> +                         versions->tags)
> +                 versions->tags)))

Rather:

  (let ((versions (if version
                      (filter (match-lambda
                                ((candidate-version . tag)
                                 (string=? version candidate-version)))
                              versions->tag)
                      versions->tag)))
    (if (null? versions) …))

> +            (match (last version-to-pick)
> +                   ((version . tag)
> +                    (values version tag)))))))))

Please adjust the indentation of the ‘match’ form so it matches what is
done elsewhere.

Otherwise LGTM.

Ludo’.