all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: 61930@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#61930] [PATCH] import: factorising git->origin in guix/import/utils.scm.
Date: Fri, 07 Apr 2023 17:26:40 +0200	[thread overview]
Message-ID: <87a5zjlnm7.fsf@gmail.com> (raw)
In-Reply-To: <20230303110619.21119-1-ngraves@ngraves.fr>

Hi Nicolas,

Sorry for the late reply.

On ven., 03 mars 2023 at 12:06, Nicolas Graves via Guix-patches via <guix-patches@gnu.org> wrote:
> ---
>  guix/import/elpa.scm     | 44 +++++++++++--------------------------
>  guix/import/go.scm       | 47 +++++++++-------------------------------
>  guix/import/minetest.scm | 28 ++----------------------
>  guix/import/utils.scm    | 36 ++++++++++++++++++++++++++++++
>  tests/minetest.scm       | 11 ++--------
>  5 files changed, 63 insertions(+), 103 deletions(-)

This patch does not apply anymore.  Could you rebase it on the top of
master?

Well, when using “git format-patch” the option ’--base’ is helpful for
this kind of cases because it stores the base commit against which it
applies.  Then, anyone is able to easily rebase.


> +(define (ref recipe)
> +  "Create REF from MELPA RECIPE."

Maybe instead, I would move this as a local definition under
’melpa-recipe->origin’.

> diff --git a/guix/import/utils.scm b/guix/import/utils.scm
> index 72795d2c61..3b31338e00 100644
> --- a/guix/import/utils.scm
> +++ b/guix/import/utils.scm
> @@ -13,6 +13,7 @@
>  ;;; Copyright © 2022 Alice Brenon <alice.brenon@ens-lyon.fr>
>  ;;; Copyright © 2022 Kyle Meyer <kyle@kyleam.com>
>  ;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
> +;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -40,6 +41,8 @@ (define-module (guix import utils)
>    #:use-module (guix discovery)
>    #:use-module (guix build-system)
>    #:use-module (guix gexp)
> +  #:use-module (guix git)
> +  #:use-module (guix hash)
>    #:use-module ((guix i18n) #:select (G_))
>    #:use-module (guix store)
>    #:use-module (guix download)
> @@ -63,6 +66,7 @@ (define-module (guix import utils)
>  
>              url-fetch
>              guix-hash-url
> +            git->origin
>  
>              package-names->package-inputs
>              maybe-inputs
> @@ -153,6 +157,38 @@ (define (guix-hash-url filename)
>    "Return the hash of FILENAME in nix-base32 format."
>    (bytevector->nix-base32-string (file-sha256 filename)))
>  
> +(define* (git->origin repo-url ref #:optional ref->commit)
> +  "Generate the `origin' block of a package depending on the git source
> +control system. REPO-URL or REF can be null."
> +  (let-values (((directory commit)
> +                (with-store store
> +                  (latest-repository-commit store repo-url #:ref ref))))
> +    (let* ((version (if (pair? ref)
> +                        (cdr ref)
> +                        #f))
> +           (vcommit (match ref->commit
             --^
         why vcommit?

Why not ’identifier’?


Cheers,
simon




  reply	other threads:[~2023-04-07 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-03 10:36 [bug#61930] [PATCH 0/1] Factorising git->origin function for imports Nicolas Graves via Guix-patches via
2023-03-03 11:06 ` [bug#61930] [PATCH] import: factorising git->origin in guix/import/utils.scm Nicolas Graves via Guix-patches via
2023-04-07 15:26   ` Simon Tournier [this message]
2024-02-03 23:38 ` bug#61930: close 61930 Nicolas Graves via Guix-patches via

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

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

  git send-email \
    --in-reply-to=87a5zjlnm7.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=61930@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.