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 ms1.migadu.com with LMTPS id YHtLAbsEE2ZQxwAA62LTzQ:P1 (envelope-from ) for ; Sun, 07 Apr 2024 22:40:27 +0200 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 YHtLAbsEE2ZQxwAA62LTzQ (envelope-from ) for ; Sun, 07 Apr 2024 22:40:27 +0200 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=GmcFKdTR; 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=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1712522427; 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=cvGa88s4XJOzrayXoaISyWAvNilcSrEZUuWaY33U+Qc=; b=aWjyd9Cm05mIFtHZpunyHR0UQoj7QsmL1Id/BZDPO6z26V6m9llwkI4Fu3fqaa/WZaMGm0 CDv/L7E6kUwgUzRdtg4v0YScryGmJweyIC1sY0nuZP7ayAr4YhZfo/zS9dQPM5/L33tVEl YRu9ck4Y4DbgKbnTGmWiLs8Jg2gzP1sPvQaXPYO/FYP2eWe+eSg+dXIDxG8EGOl23vilGM CcJ/D8UXDxmIhbJJ3bO1i1gxeecgh0EHnTH0EbKoQkcPN+78iguLfyaHQSqokWkTuxA2PL QxXZKZ+tzTjktFAIGjV2yyWN4My7DTtU25NkVL4bxlgt6xBBR8RfIH6KmM4OLg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1712522427; a=rsa-sha256; cv=none; b=kKUcX2j9s1qIIAVzbQtLCwpgc2K7pqoZSng4+HtZ6sGrjVYKIV85VtbUHiymvzI5MfMg4W EuDCYOa+Ys8Ii4fsICQ8lkd0SN3iyn3s3SVhv25Ap4B15wTXTvShknZ4Q2OufP35pjMren VLuw/YFROTpr42wJehdDDP+rAJfIPa4PmiTYLUrmai4n+s30xc94lDg/9eXEEN8Boj+CZF 8ITKuvva6eK2yGg/DFcWr7WDnZhpq2Oo+6C1flv1xy8yglvtXKTYIFUU2dEZuYCElBgldc Zg0YVQ8WuY/Ngf1w7XkCUsK/YV8CDdhxPHT4P22lidviGP6/rsU/4sa1ljAN/A== 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=GmcFKdTR; 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=pass (policy=none) header.from=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 D48D6622D8 for ; Sun, 7 Apr 2024 22:40:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtZJ5-00018b-IY; Sun, 07 Apr 2024 16:40:03 -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 1rtZJ4-00017c-8m for guix-patches@gnu.org; Sun, 07 Apr 2024 16:40:02 -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 1rtZJ3-0005xm-U8; Sun, 07 Apr 2024 16:40:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtZJ8-00013C-3o; Sun, 07 Apr 2024 16:40:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69780] [PATCH v2 2/5] 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: Sun, 07 Apr 2024 20:40:06 +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.17125223513696 (code B ref 69780); Sun, 07 Apr 2024 20:40:06 +0000 Received: (at 69780) by debbugs.gnu.org; 7 Apr 2024 20:39:11 +0000 Received: from localhost ([127.0.0.1]:44802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtZIE-0000xR-Aq for submit@debbugs.gnu.org; Sun, 07 Apr 2024 16:39:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtZI6-0000v2-F6 for 69780@debbugs.gnu.org; Sun, 07 Apr 2024 16:39:05 -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 1rtZHt-0005px-VS; Sun, 07 Apr 2024 16:38:50 -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=cvGa88s4XJOzrayXoaISyWAvNilcSrEZUuWaY33U+Qc=; b=GmcFKdTR7EdoGqUa45mU 1tuQO0nGxf6XNWa0fZHYEkS3Po3Ig+mW13fo2OkJvPdAKKy8MIr/PjoUFQtpWO7Mdn41u/DKHwObj zrOXe1DOUOWSdR7SWiFrk6VJnz0dztTfjVUL5dMAA/3VxiiswqMyCbizz0U1synvkBtUfT1lJj49L XSBTkURnPOPu6EJPBTsoLDGF5yo3J0tnsH600mF2FxjXzDNbwF0ikMMvJqNvr9aFnz00zs9nniXl4 iWjUgXUKkY7X+yfBTjO5tjbC8xCCCo89C15A0T19D4Pj9Uy8dOGfELsnP6p0XhLF4fLAZS1qQmCY6 Jq1MBPEReYAEDA==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Sun, 7 Apr 2024 22:38:27 +0200 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.57 X-Spam-Score: -4.57 X-Migadu-Queue-Id: D48D6622D8 X-Migadu-Scanner: mx13.migadu.com X-TUID: QuGraIdAZH2z 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 a606f1c146..d81a0e1ffb 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 (current-branch repository) "Return the name of the checked out branch of REPOSITORY or #f if it could @@ -236,9 +236,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