From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IB2aAFEq3mT5xQAASxT56A (envelope-from ) for ; Thu, 17 Aug 2023 16:10:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id WAprAFEq3mSa8gAA9RJhRA (envelope-from ) for ; Thu, 17 Aug 2023 16:10:25 +0200 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 9F9E54823C for ; Thu, 17 Aug 2023 16:10:24 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=BwZ4eChk; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692281424; h=from:from:sender:sender: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=w0VqyJE+c55ki3izHRi5NJ+lBrraHalgA8+CazbDL7Q=; b=lpYkLLVBcwa/Y0MSgd4vILl8Vu7xmnWvbwhrLp7M5sbsPfTo0YiY+l//5hae9dMeEg+QGb iemYOD50NbWsk/WJQOCAMphLJK2u7cgUVnUDjok1lGDIoeYjPgIOdCoeGHSGbtPAddLGtB wk4VtL49+bLzdK+HsLh7zNX7kxjWZUvx5rqGrxKjOghfILuv7icRvCoRdVQI3CTmjleAxd HA1fdM/N5M+qjYjBQdmOJjICCQG4dW6f974C3p4Q1VaXkCqa7sylgW3jb4BzX2fp80g3cy F5toQ3UJKtL0ge74DpMHXsu8T9GXX7NcN4SlSkR/EtChk/DEPBepbBNG2ukAsQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=BwZ4eChk; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692281424; a=rsa-sha256; cv=none; b=T4rlwuFq+rnPltsVimQSly84xm2cZDiLJ/jp7SIJwDjGDn8dxktM+mm3tvxwWNQVaz0q7B CO9i290bT3mcFLZaNvCyT+r6AxT8i9jq6Jfdv1enkMuZDGm5+ESuBuMlRZAjwuc82hkUxA DFKyeRjPTqZxxwZrpNBMry7bURBwwQ2h1JTOKZekUjL96o+r/CCZglFHmGFXi/bP6cQ4VO PieItqJWtPFx8MJXRI99CxtxokpfLlLO4qVEPKVs5oVyFMsStcfJgM07h3hi40uTIKaTfK 2UDwON3k96vTU0lDuIGMr+kbRgS6Jf3hmxKw3a9n8t7WSn7+3TWd++dZUtq72Q== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWdhT-00078s-Uf; Thu, 17 Aug 2023 10:10:12 -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 1qWdhP-00073A-2T for guix-patches@gnu.org; Thu, 17 Aug 2023 10:10:07 -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 1qWdhK-0006Yy-Mc for guix-patches@gnu.org; Thu, 17 Aug 2023 10:10:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWdhK-0007c5-If for guix-patches@gnu.org; Thu, 17 Aug 2023 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65352] [PATCH 1/2] guix: git: Fix the procedure reference-available?. References: <87fs4h4vb9.fsf@gmail.com> In-Reply-To: <87fs4h4vb9.fsf@gmail.com> Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Aug 2023 14:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65352 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 65352@debbugs.gnu.org Cc: Simon Tournier Received: via spool by 65352-submit@debbugs.gnu.org id=B65352.169228136729204 (code B ref 65352); Thu, 17 Aug 2023 14:10:02 +0000 Received: (at 65352) by debbugs.gnu.org; 17 Aug 2023 14:09:27 +0000 Received: from localhost ([127.0.0.1]:45276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWdgl-0007aw-II for submit@debbugs.gnu.org; Thu, 17 Aug 2023 10:09:27 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:40296) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWdgj-0007ad-DP for 65352@debbugs.gnu.org; Thu, 17 Aug 2023 10:09:26 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3fe8d816a40so12946805e9.1 for <65352@debbugs.gnu.org>; Thu, 17 Aug 2023 07:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692281359; x=1692886159; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=w0VqyJE+c55ki3izHRi5NJ+lBrraHalgA8+CazbDL7Q=; b=BwZ4eChkpc/xjqZ5Xm5hCE6xcOqFf7NiV4lv6PQKi41xw8Y2Voh3oeuz5bE0Vs796H M/qfsutLaa+C7wADg/RSi7dNS45IitlUh6oeCR+h0rjUZiblk8d3FsBpXJ5RksIQSxzZ 7GNAkRnw/dskn8ADN/b3WjzvbQKlGmfyNuLtWvozSgIVUGKo7jEC+NtXI/f8DxmygCnN 8/9WQEPfgA22MpeOXMpQnL7a4FJfHvpJZO2O8u4tr2vbfyBRvBx7ntf8XVuuBX+lprmG U0dzi4ZEiphaSXliVaLAPVqDJH4/52S06C7SCGYPXrsAK4BsMa28YHmwTYofvkG6fQjf xSVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281359; x=1692886159; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w0VqyJE+c55ki3izHRi5NJ+lBrraHalgA8+CazbDL7Q=; b=JitL+yRqgD/y3qz31a75I2y3DvrCPa2eAvb46P2IEsp6xkx3DGybC77ecMuKyX1Fkk GLvUwnTWuSJGD6tL1Q2zdNKkm1I3HwHwvz5CUbfahxYHALeSUxAYsio7E0G8X7HdBzk4 zNTiKYn4xb5le/MnhQGVdEoEUOF8NBtFlFtsf++P5cJ517FIPGxxcTKmC/n3BTx5EH/I AegKMvv87UWtGLZiTDZRR2mVoxPJL0/K2zfsibwEqYTQCtTpRBfMhGKXO3G+4yYYnWjA KqwDqXZZ1baEOWe+2KUPCh1ESTJZPPhdhuiugZINTBsrRn9ycL9U+HQyenmaqSiAqpYR YI1Q== X-Gm-Message-State: AOJu0YwVzyI6hx2lUAS7JinIEWsXa3E4aCrN/yYO6zia6tHdsST/90ix kapishSpIExiWn0CuSC9lT5xJO8le+g= X-Google-Smtp-Source: AGHT+IHKSBnsvIl3bH5fwa+HfUlKALFj67Ro5gNq7cmrjAuOVWHvl3JbHFzAH7BPZErCelqhZ/HpOQ== X-Received: by 2002:a05:600c:4710:b0:3fb:aadc:41dc with SMTP id v16-20020a05600c471000b003fbaadc41dcmr4594824wmo.4.1692281359460; Thu, 17 Aug 2023 07:09:19 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id 10-20020a05600c228a00b003fe4ca8decdsm3135502wmf.31.2023.08.17.07.09.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:09:19 -0700 (PDT) From: Simon Tournier Date: Thu, 17 Aug 2023 16:09:16 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 3.30 X-Spam-Score: 3.30 X-Migadu-Queue-Id: 9F9E54823C X-Migadu-Scanner: mx1.migadu.com X-TUID: Gyzo81pFyAgc * guix/git/scm (reference-available?): Rely of the procedure resolve-reference to determine if the reference belongs to the local Git checkout. --- guix/git.scm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dbc3b7caa7..ebe2600209 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -360,17 +360,8 @@ (define-syntax-rule (false-if-git-not-found exp) (define (reference-available? repository ref) "Return true if REF, a reference such as '(commit . \"cabba9e\"), is definitely available in REPOSITORY, false otherwise." - (match ref - ((or ('commit . commit) - ('tag-or-commit . (? commit-id? commit))) - (let ((len (string-length commit)) - (oid (string->oid commit))) - (false-if-git-not-found - (->bool (if (< len 40) - (object-lookup-prefix repository oid len OBJ-COMMIT) - (commit-lookup repository oid)))))) - (_ - #f))) + (false-if-git-not-found + (->bool (resolve-reference repository ref)))) (define (clone-from-swh url tag-or-commit output) "Attempt to clone TAG-OR-COMMIT (a string), which originates from URL, using base-commit: 1b2d43fe016848ea2ec16ff18cbc14340944fc4e -- 2.38.1