From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6KsZDJhd6GYIjwAA62LTzQ:P1 (envelope-from ) for ; Mon, 16 Sep 2024 16:32:24 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 6KsZDJhd6GYIjwAA62LTzQ (envelope-from ) for ; Mon, 16 Sep 2024 18:32:24 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=LXSBZatZ; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=EkFqI7Od; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726504344; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=eKjwHNpcFAVHA5jSEs9mCLuK/E8nyh+ECsWHiwAHNCo=; b=DNfFoTn4B3/e7lcmNP1WbX3BkH2P6lL3CAswFLkifJD5U4frhvWuDL0n6ENP8A4gJtUMOq v8R4OjEwK3zxdv/6JAW8k3ny9MyPOqf5LmUwoIUodWyUYlrnJsahUF9e4YPNfmnFVwIEmF +c2Cencd5BA0xWjR7ODlMCRl6lHKrxeJlKxu4z7tGlU+Ope05v8FmMg7unmRnP8jfwe2BY chxVPTWoSf5tAKFnKqCfvdZa22hzp/FuhFT6hxykJrt+4MBG2fI3WdMXMV/Sp2ZCYl5Ifs z/3iwLRuonxfZ+joxZfwGnaGjlhpUG/su/p0+EHIeThXpnLGAgOlCUs3C2cx4g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726504344; a=rsa-sha256; cv=none; b=Pw6oMslNdJLvxnAnkrjgWHS1Hi6LcSReadqR5Fn+C2g5Mi8hwZRp/KR2tRlizcIJrniSYk LRwbbzvzmWIyznG8+qDctnaACVIz3HTR7+k5TVmsZPhUh0jgFT+ZrtUt53XGsNnIK13q8G K5BSKVFuQHqwcEQsqscNSCch4B9E65NBnPDy6yQkIZQXOWtUKslF103BanQ6zt6JofNhjn F0f8oXiWwtrfhNz9UrIJ0Aq5clIBJ5RHq3KN6p+Hizvpw6m3XSmBbKPO7WCN6AnLcJUsOt wkXz636RtVUF6hFLe9n+4rSR+t2lElDif+djNNhormS6yCBeTT61mkNhamlEWQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=LXSBZatZ; dkim=fail ("headers rsa verify failed") header.d=rimm.ee header.s=herman header.b=EkFqI7Od; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 209AA11ED3 for ; Mon, 16 Sep 2024 18:32:24 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqEdp-0007ch-F5; Mon, 16 Sep 2024 12:31:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqEdn-0007Tn-Ok for guix-patches@gnu.org; Mon, 16 Sep 2024 12:31:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqEdn-0004NF-Er; Mon, 16 Sep 2024 12:31:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=eKjwHNpcFAVHA5jSEs9mCLuK/E8nyh+ECsWHiwAHNCo=; b=LXSBZatZHiocGgmholgLlGxyZA+xTTWs+ZsEbjzju9/iNGcmPOYAFMpMr9W0hfqEE1lFs/PRC5rXMLvfVTvuDqzx6GxwdDCIuT6ufeFIss1h1eQq3gwOwA6qs/lQriYsGLiPe0XCOaNtR98dF0R9gP7BMsGOipc7vQh72eD9XUVp4N38mICSOyrbBY2Os4Z8hgm5xweB4gLVVCk75Su1pkRlnZPIcJjCovfyVS9l44SWYsb6qStdrKV7XrXPRvRG08KC+Jw4Db6TednEl7W+rOwNBv8VJE3OP/abtLnNpOm8uGV3zxVPEx4nsOly1OmTlG5nwwPPtgjzgAzGCW6umw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqEdu-0001vn-V1; Mon, 16 Sep 2024 12:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73126] [PATCH v2 1/2] download: Add git-source. Resent-From: Herman Rimm Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, pelzflorian@pelzflorian.de, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, maxim.cournoyer@gmail.com, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 16 Sep 2024 16:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73126 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73126@debbugs.gnu.org Cc: Christopher Baines , Florian Pelz , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Florian Pelz , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Maxim Cournoyer , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 73126-submit@debbugs.gnu.org id=B73126.17265042877344 (code B ref 73126); Mon, 16 Sep 2024 16:32:02 +0000 Received: (at 73126) by debbugs.gnu.org; 16 Sep 2024 16:31:27 +0000 Received: from localhost ([127.0.0.1]:53159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqEdL-0001uN-Br for submit@debbugs.gnu.org; Mon, 16 Sep 2024 12:31:27 -0400 Received: from 81-205-150-117.fixed.kpn.net ([81.205.150.117]:52173 helo=email.rimm.ee) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqEdG-0001td-8a for 73126@debbugs.gnu.org; Mon, 16 Sep 2024 12:31:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rimm.ee; s=herman; t=1726504257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eKjwHNpcFAVHA5jSEs9mCLuK/E8nyh+ECsWHiwAHNCo=; b=EkFqI7OdvynHmM+3LyJ/OOKPWikS8Uc7KPghy8rBdSfmuAbH0B49f3JFqIsP8HfICFFh2M lSHqGPHUu5YZsJ3e/w5S/SGuXCPoZ2dOepKhOankT4TwLXArKQGk16FsQIXBWgCfj5x//Q 9EZul4zx6eBG5JKCkBDREBl3Df9C6bWWN5xFK278tRQsqic7HvjyyzsdqpNrUFVYpsPTMX P/zm6bEmm0TfpozYQMqGa+ec1VeamekjFIzs9e4IJXJXg0XHyNDWSHten84qm3Y0ovbyho teDyp8dcLzWahUHg6k7BJmDPdlpYaiEi1w8Llm1+nwz/tp779nqbYIDiMXiLLA== Received: by 81-205-150-117.fixed.kpn.net (OpenSMTPD) with ESMTPSA id f252f8a4 (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO) for <73126@debbugs.gnu.org>; Mon, 16 Sep 2024 16:30:57 +0000 (UTC) Date: Mon, 16 Sep 2024 18:29:57 +0200 Message-ID: <6857a5838688c629dc90efd5fe3769a7d4301223.1726495443.git.herman@rimm.ee> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Herman Rimm X-ACL-Warn: , Herman Rimm via Guix-patches From: Herman Rimm via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.91 X-Spam-Score: -2.91 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Queue-Id: 209AA11ED3 X-TUID: D1tGFakKMnAO * guix/git-download.scm (git-source): Add and export procedure. * doc/guix.texi (origin Reference): Document git-source. Change-Id: I40c24ff10135e4895c5319f969005ba1c09760db --- doc/guix.texi | 7 +++++++ guix/git-download.scm | 12 +++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/guix.texi b/doc/guix.texi index bc4d306c2d..fa64c6a3fc 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8248,6 +8248,13 @@ origin Reference @end lisp @end deftp +@deffn {Procedure} git-source hash host author project commit [prefix] +Return an @code{origin} corresponding to the @var{host}'s repository for +the @var{author}'s @var{project}. It is checked out at @var{commit}, +with a consistent @var{prefix} used in some repositories. @var{hash} is +the string for a base32-encoded SHA256 hash used by @code{git-fetch}. +@end deffn + For Mercurial repositories, the module @code{(guix hg-download)} defines the @code{hg-fetch} origin method and @code{hg-reference} data type for support of the Mercurial version control system. diff --git a/guix/git-download.scm b/guix/git-download.scm index ae2073ea06..6de53fec70 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -59,7 +59,8 @@ (define-module (guix git-download) git-fetch/lfs git-version git-file-name - git-predicate)) + git-predicate + git-source)) ;;; Commentary: ;;; @@ -395,4 +396,13 @@ (define* (git-predicate directory #:key (recursive? #t)) (#f #f))))) (const #f))) +(define* (git-source hash host author project commit #:optional prefix) + (origin + (method git-fetch) + (uri (git-reference + (url (string-join (list "https:/" host author project) "/")) + (commit (if prefix (string-append prefix commit) commit)))) + (file-name (git-file-name project commit)) + (hash (content-hash (base32 hash) sha256)))) + ;;; git-download.scm ends here -- 2.45.2