guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#53144] [PATCH 0/13] Make more git-using packages auto-updatable


From: Ludovic Courtès
Subject: [bug#53144] [PATCH 0/13] Make more git-using packages auto-updatable
Date: Tue, 18 Jan 2022 18:39:39 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Maxime Devos <maximedevos@telenet.be> skribis:

> * guix/git.scm (remote-refs): Split off some logic to ...
>   (call-with-detached-remote): ... this new procedure.
>   (lookup-reference): New procedure.
> * tests/git.scm ("lookup-reference: branch and HEAD"): New test.

[...]

> +;; TODO: it would be nice to use 'remote-create-detached' here,
> +;; but that procedure isn't in any released version of guile-git yet.
> +(define (call-with-detached-remote url proc)

Let’s prepare a new Guile-Git release then (Erik Edrosa has been MIA
lately, but Marius, Mathieu, or myself can tag a release when needed).

> +  "Call PROC with a remote for URL.  The remote is closed after PROC 
> returns."
> +  (call-with-temporary-directory
> +   (lambda (cache-directory)
> +     (let* ((repository (repository-init cache-directory))
> +            ;; Create an in-memory remote so we don't touch disk.
> +            (remote (remote-create-anonymous repository url)))
> +       (remote-connect remote)
> +       (let-values ((result (proc remote)))

s/let-values/let/

> +         ;; Wait until we're finished with the repository before closing it.
> +         (remote-disconnect remote)
> +         (repository-close! repository)
> +         (apply values result))))))

We can use this code until Guile-Git provides ‘remote-create-detached’
though.

Otherwise LGTM!

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]