[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69780] [PATCH 2/4] git authenticate: Discover the repository.
From: |
Ludovic Courtès |
Subject: |
[bug#69780] [PATCH 2/4] git authenticate: Discover the repository. |
Date: |
Wed, 13 Mar 2024 18:42:20 +0100 |
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
- [bug#69780] [PATCH 0/4] Simplify 'guix git authenticate' usage, Ludovic Courtès, 2024/03/13
- [bug#69780] [PATCH 2/4] git authenticate: Discover the repository.,
Ludovic Courtès <=
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Ludovic Courtès, 2024/03/13
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Tomas Volf, 2024/03/16
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Ludovic Courtès, 2024/03/19
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Ludovic Courtès, 2024/03/20
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Tomas Volf, 2024/03/20
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Ludovic Courtès, 2024/03/29
- [bug#69780] [PATCH 1/4] git authenticate: Record introduction and keyring in ‘.git/config’., Tomas Volf, 2024/03/31
[bug#69780] [PATCH 4/4] DRAFT news: Add entry for ‘guix git authenticate’ changes., Ludovic Courtès, 2024/03/13