guix-commits
[Top][All Lists]
Advanced

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

03/05: git: <git-checkout> allows tags in its 'commit' field.


From: guix-commits
Subject: 03/05: git: <git-checkout> allows tags in its 'commit' field.
Date: Fri, 26 Jul 2019 05:23:34 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 177fecb57c0c9e15249bf6a49244c9dc6eb8439c
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jul 26 11:09:56 2019 +0200

    git: <git-checkout> allows tags in its 'commit' field.
    
    Fixes <https://bugs.gnu.org/36371>.
    Reported by Tobias Geerinckx-Rice <address@hidden>.
    
    * guix/git.scm (git-checkout-compiler): Pass 'tag-or-commit' to
    'latest-repository-commit*'.
    * doc/guix.texi (Package Transformation Options): Update '--with-commit'
    documentation accordingly.
    * tests/guix-build-branch.sh: Add test.
---
 doc/guix.texi              | 2 +-
 guix/git.scm               | 4 ++--
 tests/guix-build-branch.sh | 8 +++++++-
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index c2da4ce..96448c2 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8048,7 +8048,7 @@ guix build --with-branch=guile-sqlite3=master cuirass
 @item --with-commit=@var{package}=@var{commit}
 This is similar to @code{--with-branch}, except that it builds from
 @var{commit} rather than the tip of a branch.  @var{commit} must be a valid
-Git commit SHA1 identifier.
+Git commit SHA1 identifier or a tag.
 @end table
 
 @node Additional Build Options
diff --git a/guix/git.scm b/guix/git.scm
index fb2df2d..8525262 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -330,7 +330,7 @@ Log progress and checkout info to LOG-PORT."
   git-checkout?
   (url     git-checkout-url)
   (branch  git-checkout-branch (default "master"))
-  (commit  git-checkout-commit (default #f))
+  (commit  git-checkout-commit (default #f))      ;#f | tag | commit
   (recursive? git-checkout-recursive? (default #f)))
 
 (define* (latest-repository-commit* url #:key ref recursive? log-port)
@@ -369,7 +369,7 @@ Log progress and checkout info to LOG-PORT."
     (($ <git-checkout> url branch commit recursive?)
      (latest-repository-commit* url
                                 #:ref (if commit
-                                          `(commit . ,commit)
+                                          `(tag-or-commit . ,commit)
                                           `(branch . ,branch))
                                 #:recursive? recursive?
                                 #:log-port (current-error-port)))))
diff --git a/tests/guix-build-branch.sh b/tests/guix-build-branch.sh
index e64782c..0cec7c7 100644
--- a/tests/guix-build-branch.sh
+++ b/tests/guix-build-branch.sh
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2018 Ludovic Courtès <address@hidden>
+# Copyright © 2018, 2019 Ludovic Courtès <address@hidden>
 #
 # This file is part of GNU Guix.
 #
@@ -52,5 +52,11 @@ guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.9e3eacd
 test "$v0_1_0_drv" != "$latest_drv"
 test "$v0_1_0_drv" != "$orig_drv"
 
+v0_1_0_drv="`guix build guix --with-commit=guile-gcrypt=v0.1.0 -d`"
+guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-git.v0.1.0
+guix gc -R "$v0_1_0_drv" | grep guile-gcrypt-8fe64e8 # this is the *tag* ID
+test "$v0_1_0_drv" != "$latest_drv"
+test "$v0_1_0_drv" != "$orig_drv"
+
 if guix build guix --with-commit=guile-gcrypt=000 -d
 then false; else true; fi



reply via email to

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