diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2018-11-30 13:24:48 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-11-30 17:03:04 +0100 |
commit | b18f7234aac9eb42097c1b4cda7efe0be5aab132 (patch) | |
tree | b4381cbb251ad72d35096e38a068f3bd4564aa0f /guix/git.scm | |
parent | 96915a448cfe8383a1c47f4b9a1cc810e5161fd0 (diff) | |
download | patches-b18f7234aac9eb42097c1b4cda7efe0be5aab132.tar patches-b18f7234aac9eb42097c1b4cda7efe0be5aab132.tar.gz |
guix build: Add '--with-commit'.
* guix/git.scm (<git-checkout>)[commit]: New field.
(git-checkout-compiler): Honor it.
* guix/scripts/build.scm (evaluate-git-replacement-specs): Add 'proc'
parameter and honor it.
(transform-package-source-branch)[replace]: New procedure.
Adjust 'evaluate-git-replacement-specs' accordingly.
(transform-package-source-commit): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help): Add 'with-commit'.
* tests/guix-build-branch.sh: Add test.
* doc/guix.texi (Package Transformation Options): Document it.
Diffstat (limited to 'guix/git.scm')
-rw-r--r-- | guix/git.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/guix/git.scm b/guix/git.scm index 56cebb06ed..f5593ab57c 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -198,12 +198,13 @@ Log progress and checkout info to LOG-PORT." ;;; Checkouts. ;;; -;; Representation of the "latest" checkout of a branch. +;; Representation of the "latest" checkout of a branch or a specific commit. (define-record-type* <git-checkout> git-checkout make-git-checkout git-checkout? (url git-checkout-url) - (branch git-checkout-branch (default "master"))) + (branch git-checkout-branch (default "master")) + (commit git-checkout-commit (default #f))) (define latest-repository-commit* (store-lift latest-repository-commit)) @@ -213,7 +214,9 @@ Log progress and checkout info to LOG-PORT." ;; "Compile" CHECKOUT by updating the local checkout and adding it to the ;; store. (match checkout - (($ <git-checkout> url branch) + (($ <git-checkout> url branch commit) (latest-repository-commit* url - #:ref `(branch . ,branch) + #:ref (if commit + `(commit . ,commit) + `(branch . ,branch)) #:log-port (current-error-port))))) |