From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id sNegDj/m8WU1ggAAe85BDQ:P1 (envelope-from ) for ; Wed, 13 Mar 2024 18:45:35 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id sNegDj/m8WU1ggAAe85BDQ (envelope-from ) for ; Wed, 13 Mar 2024 18:45:35 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FMb8R1hH; 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-Seal: i=1; s=key1; d=yhetil.org; t=1710351935; a=rsa-sha256; cv=none; b=I48ib6223mO6UD8Lj8Hh02EsG4NFqlvrTiuj8aX43MD8k2QUl0nsH693JWFBCUsHgugCux F5q9rlqv1h1MqQB2U2u0AeKklpm+6o29HcJjZOt2BiroWGo1tE02EKC+ymK9nJtRmnKJ2F 03zlr3lokQT5wswl+d3peh5kibqR3d+YHyFJeUSbJtqWSMZ7l1LoSFeVr6ZpzWK1CSB1g6 9WDa9YTDfHJBX6GctA6Pt1xn3TmhuH9T53vsN7ojpA543ixUqO2lGF8BVfc0h2tIRUt/Lt RuZ58SjX8JagpYAgPYNAwATz9rPtp0gqUr6n9arbM7cUaGiokt8pndlY+AUu1g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=FMb8R1hH; 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=1710351935; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=wYNpMwy3YvfILQnVZiWDF4E+radtE/xWwh0rzUXvgCE=; b=PlDkHC3bVJSsN52XVnbeCWby3AVdXH3jdRH/nzOhuYU3hSZYJdi6X4AJ59EMY6ermPeusP hJ5KS6z1hnstrBruCw89uWFi/fXARecmq8E0NjFEgnwDGzhxpfnJcrO+VJ3U8ryt4eclax zLsJkPMhUCCxA2wPULx1RA3JOAsebhr69FlyXiccP2IHwp8zj7xeq4td5h7/O8Ap0pZ/Z+ SDnyeXreYjUb2NheoqjqFiPR5TDzimSPeUww30cMRQaBs2UDaecrAWCmLhwcBHES/NDccd XdgzqG/obeTBKVt7JHpsROLti3gwoK7wNASS+mUdtV2ZRdByLLDNia4SrLbfHg== 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 0AA298DCE for ; Wed, 13 Mar 2024 18:45:35 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rkSfQ-0000Vq-RE; Wed, 13 Mar 2024 13:45:28 -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 1rkSfP-0000Vh-Q8 for guix-patches@gnu.org; Wed, 13 Mar 2024 13:45:27 -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 1rkSfP-0001mB-Fv; Wed, 13 Mar 2024 13:45:27 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rkSfy-0008Jy-E1; Wed, 13 Mar 2024 13:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69780] [PATCH 2/4] git authenticate: Discover the repository. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Wed, 13 Mar 2024 17:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69780 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69780@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69780-submit@debbugs.gnu.org id=B69780.171035193031910 (code B ref 69780); Wed, 13 Mar 2024 17:46:02 +0000 Received: (at 69780) by debbugs.gnu.org; 13 Mar 2024 17:45:30 +0000 Received: from localhost ([127.0.0.1]:47354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkSfS-0008Ia-3R for submit@debbugs.gnu.org; Wed, 13 Mar 2024 13:45:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:48732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rkSfQ-0008IG-6s for 69780@debbugs.gnu.org; Wed, 13 Mar 2024 13:45:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rkScf-0000vc-Gr; Wed, 13 Mar 2024 13:42:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=wYNpMwy3YvfILQnVZiWDF4E+radtE/xWwh0rzUXvgCE=; b=FMb8R1hHalOuy0m9ucPx 5/qztgEv8zjWe3kpIkuKb4S4/At6PC7cM//ptKr9hoThslbCbPLkAkAcmrbTyi/kXMU9kTm/4gTG1 EbgmSR2c0KKjb13XPisT27nqp1hSZ2qswvmK7KIjEnDlK5h+ql0OlPFwX1EHudR/J+YzQqhu33ROs zarWmKUE4AOcdt6cDfuVQH5qRqvw9laAz+fuNCnSOiq/ntdBnQXqaz8E4AaT8z+fttZk5vMkSibT3 MB64ukxAIHOC6hG1XWwVn4It63RPNYWBYlce8YQd5j9L6q+xYB9X7yNd6Pdh90R9ahS+A3/r018Fs JpW6WS2+tl4HZw==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Wed, 13 Mar 2024 18:42:20 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -4.69 X-Spam-Score: -4.69 X-Migadu-Queue-Id: 0AA298DCE X-TUID: 9cFroSs3TQ3i This allows one to run ‘guix git authenticate’ from a sub-directory of the checkout. * guix/scripts/git/authenticate.scm (%default-options): Remove ‘directory’ key. (guix-git-authenticate): Use ‘repository-discover’ when ‘directory’ option is missing. Change-Id: Ifada00d559254971ed7eeb8c0a8d4ae74ff3defc --- guix/scripts/git/authenticate.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/scripts/git/authenticate.scm b/guix/scripts/git/authenticate.scm index d3cc4065df..36e1aa6228 100644 --- a/guix/scripts/git/authenticate.scm +++ b/guix/scripts/git/authenticate.scm @@ -74,7 +74,7 @@ (define %options (alist-cons 'show-stats? #t result))))) (define %default-options - '((directory . "."))) + '()) (define (config-value config key) "Return the config value associated with KEY, or #f if no such config was @@ -215,9 +215,9 @@ (define (guix-git-authenticate . args) (with-error-handling (with-git-error-handling - (let* ((directory (assoc-ref options 'directory)) - (show-stats? (assoc-ref options 'show-stats?)) - (repository (repository-open directory)) + (let* ((show-stats? (assoc-ref options 'show-stats?)) + (repository (repository-open (or (assoc-ref options 'directory) + (repository-discover ".")))) (commit signer (match (command-line-arguments options) ((commit signer) (values commit signer)) -- 2.41.0