guix-patches
[Top][All Lists]
Advanced

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

[bug#50274] [PATCH] guix: git: Adds feature to download git repository t


From: Ludovic Courtès
Subject: [bug#50274] [PATCH] guix: git: Adds feature to download git repository to the store.
Date: Fri, 24 Sep 2021 14:25:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi Julien & jgart,

jgart <jgart@dismail.de> skribis:

> From: Julien Lepiller <julien@lepiller.eu>
>
> * guix/git.scm (download-git-to-store): Download Git repository from
> URL at COMMIT to STORE, either under NAME or URL's basename if omitted.
> Write progress reports to LOG.  RECURSIVE? has the same effect as the
> same-named parameter of 'git-fetch'.
>
> * guix/scripts/download.scm (download-git-to-store*): Adds cli option.
> Examples:
> guix download --git-commit=v0.1.1 github.com/anaseto/gruid-tcell
> guix download -c v0.1.1 https://github.com/anaseto/gruid-tcell

Very useful!

> +(define* (download-git-to-store store url commit
> +                             #:optional (name (basename url))
> +                                #:key (log (current-error-port)) recursive?)
> +  "Download Git repository from URL at COMMIT to STORE, either under NAME or
> +URL's basename if omitted.  Write progress reports to LOG.  RECURSIVE? has 
> the
> +same effect as the same-named parameter of 'git-fetch'."

Can we use ‘latest-repository-commit’ instead?  The difference is that
it’ll populate ~/.cache/guix/checkouts, but I think that’s fine.

OTOH, if we want to make it easier to support other VCSes, we can choose
to not use (guix git) at all and instead use ‘git-fetch’ in (guix
git-download), ‘hg-fetch’ in (guix hg-download), etc.  This code would
go to (guix scripts hash).

WDYT?

[...]

> +     (option '(#\c "git-commit") #t #f
> +             (lambda (opt name arg result)
> +               (alist-cons 'commit arg result)))

For consistency with package transformation options, I’d call it
‘--commit’.  This option would still apply if/when other VCSes are
supported.

This would also need an update of the manual.

Thanks,
Ludo’.





reply via email to

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