From b18f7234aac9eb42097c1b4cda7efe0be5aab132 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Fri, 30 Nov 2018 13:24:48 +0100 Subject: guix build: Add '--with-commit'. * guix/git.scm ()[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. --- guix/git.scm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'guix/git.scm') 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 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 - (($ url branch) + (($ url branch commit) (latest-repository-commit* url - #:ref `(branch . ,branch) + #:ref (if commit + `(commit . ,commit) + `(branch . ,branch)) #:log-port (current-error-port))))) -- cgit v1.2.3