GNU bug report logs - #78030
[PATCH 0/2] Symref support in channels

Previous Next

Package: guix-patches;

Reported by: Romain GARBAGE <romain.garbage <at> inria.fr>

Date: Thu, 24 Apr 2025 08:19:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78030 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#78030; Package guix-patches. (Thu, 24 Apr 2025 08:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Romain GARBAGE <romain.garbage <at> inria.fr>:
New bug report received and forwarded. Copy sent to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org. (Thu, 24 Apr 2025 08:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Romain GARBAGE <romain.garbage <at> inria.fr>
To: guix-patches <at> gnu.org
Cc: ludovic.courtes <at> inria.fr, Romain GARBAGE <romain.garbage <at> inria.fr>
Subject: [PATCH 0/2] Symref support in channels
Date: Thu, 24 Apr 2025 10:14:16 +0200
This patch series adds support for symbolic references in channel
definitions (more specifically the =branch= field), which is needed to
support the Agit workflow.

Romain GARBAGE (2):
  guix: channels: Add symref support.
  guix: git: Add support for symbolic references.

 guix/channels.scm |  8 +++++++-
 guix/git.scm      | 12 ++++++++++--
 2 files changed, 17 insertions(+), 3 deletions(-)


base-commit: b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902
-- 
2.49.0





Information forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#78030; Package guix-patches. (Thu, 24 Apr 2025 08:21:04 GMT) Full text and rfc822 format available.

Message #8 received at 78030 <at> debbugs.gnu.org (full text, mbox):

From: Romain GARBAGE <romain.garbage <at> inria.fr>
To: 78030 <at> debbugs.gnu.org
Cc: ludovic.courtes <at> inria.fr, Romain GARBAGE <romain.garbage <at> inria.fr>
Subject: [PATCH 1/2] guix: channels: Add symref support.
Date: Thu, 24 Apr 2025 10:19:58 +0200
* guix/channels.scm (channel-reference): Add symref support.

Change-Id: Iea93aa22479ec21900af947c4df79a3ed97b5e62
---
 guix/channels.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index 4700f7a45d..72450da395 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -250,7 +250,13 @@ (define (channel-reference channel)
   "Return the \"reference\" for CHANNEL, an sexp suitable for
 'latest-repository-commit'."
   (match (channel-commit channel)
-    (#f      `(branch . ,(channel-branch channel)))
+    (#f      (let ((branch (channel-branch channel)))
+               (cond
+                ((and (string? branch)
+                      (string-prefix? "refs/"
+                                      branch))
+                 `(symref . ,branch))
+                (#t `(branch . ,branch)))))
     (commit  `(tag-or-commit . ,(channel-commit channel)))))
 
 (define sexp->channel-introduction

base-commit: b12d44dd5e35ac236bf3fbb5619b9c8c2f42c902
-- 
2.49.0





Information forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#78030; Package guix-patches. (Thu, 24 Apr 2025 08:21:05 GMT) Full text and rfc822 format available.

Message #11 received at 78030 <at> debbugs.gnu.org (full text, mbox):

From: Romain GARBAGE <romain.garbage <at> inria.fr>
To: 78030 <at> debbugs.gnu.org
Cc: ludovic.courtes <at> inria.fr, Romain GARBAGE <romain.garbage <at> inria.fr>
Subject: [PATCH 2/2] guix: git: Add support for symbolic references.
Date: Thu, 24 Apr 2025 10:19:59 +0200
* guix/git.scm (update-cached-checkout): Add support for symbolic references.

Change-Id: Ib7874e2a30f97e51fdfdc2231a3bc5a3b45a177d
---
 guix/git.scm | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/git.scm b/guix/git.scm
index 01e0918588..a6d921a8cf 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -563,7 +563,7 @@ (define* (update-cached-checkout url
 to REF, and the relation of STARTING-COMMIT relative to the new commit (if
 provided) as returned by 'commit-relation'.
 
-REF is pair whose key is [branch | commit | tag | tag-or-commit ] and value
+REF is pair whose key is [branch | commit | symref | tag | tag-or-commit ] and value
 the associated data: [<branch name> | <sha1> | <tag name> | <string>].
 If REF is the empty list, the remote HEAD is used.
 
@@ -599,6 +599,11 @@ (define* (update-cached-checkout url
                        (string-append "origin/" branch))))
       (_ ref)))
 
+  (define symref-list
+    (match ref
+      (('symref . symref) (list symref))
+      (_ '())))
+
   (with-libgit2
    (set-git-timeouts connection-timeout read-timeout)
    (let* ((cache-exists? (openable-repository? cache-directory))
@@ -613,7 +618,10 @@ (define* (update-cached-checkout url
        (remote-fetch (remote-lookup repository "origin")
                      #:fetch-options (make-default-fetch-options
                                       #:verify-certificate?
-                                      verify-certificate?)))
+                                      verify-certificate?)
+                     ;; Symbolic references are not fetched from the remote by
+                     ;; default.
+                     #:refspecs symref-list))
      (when recursive?
        (update-submodules repository #:log-port log-port
                           #:fetch-options
-- 
2.49.0





This bug report was last modified 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.