From 088e181c0a58bf1a03e3aa7be1202fb3cd209136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 31 Mar 2024 23:17:29 +0200 Subject: =?UTF-8?q?channels:=20Move=20=E2=80=98commit-short-id=E2=80=99=20?= =?UTF-8?q?to=20(guix=20git).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/channels.scm (commit-short-id): Move to… * guix/git.scm (commit-short-id): … here. Change-Id: If4b34b1d82b1aa5068d157f26e57e8aecc967061 --- guix/channels.scm | 4 +--- guix/git.scm | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'guix') diff --git a/guix/channels.scm b/guix/channels.scm index f26ccbc3ae..0b776ab211 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -25,6 +25,7 @@ url+commit->name commit-difference repository-info + commit-short-id with-repository) #:autoload (guix git-authenticate) (authenticate-repository) #:autoload (guix openpgp) (openpgp-public-key-fingerprint @@ -339,9 +340,6 @@ result is unspecified." (apply-patch patch checkout)) (loop rest))))) -(define commit-short-id - (compose (cut string-take <> 7) oid->string commit-id)) - (define* (authenticate-channel channel checkout commit #:key (keyring-reference-prefix "origin/")) "Authenticate the given COMMIT of CHANNEL, available at CHECKOUT, a diff --git a/guix/git.scm b/guix/git.scm index 760b064a9c..eab84ea798 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -67,6 +67,7 @@ commit-relation commit-descendant? commit-id? + commit-short-id remote-refs @@ -233,6 +234,9 @@ is a tag name. This is based on a simple heuristic so use with care!" (and (= (string-length str) 40) (string-every char-set:hex-digit str))) +(define commit-short-id + (compose (cut string-take <> 7) oid->string commit-id)) + (define (resolve-reference repository ref) "Resolve the branch, commit or tag specified by REF, and return the corresponding Git object." -- cgit v1.2.3