diff options
author | Ludovic Courtès <ludo@gnu.org> | 2025-06-08 16:27:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-06-22 23:45:32 +0200 |
commit | 55b38ddefca038da1178832734c2c2591d788221 (patch) | |
tree | e5731a6ba06ef62c1d45cfb95d10aa4b236f0c52 | |
parent | a9548c198c87095a40517dccbae0cce2ad34514a (diff) |
git authenticate: Remove support for Guile-Git < 0.7.0.
Guile-Git 0.7.0 was released in May 2024.
* guix/scripts/git/authenticate.scm (record-configuration): Remove
‘module-defined?’ condition for Guile-Git < 0.7.0.
(install-hooks): Likewise.
Change-Id: I27af82068b989d6a18ff1a66453e0a8d397ed380
-rw-r--r-- | guix/scripts/git/authenticate.scm | 73 |
1 files changed, 31 insertions, 42 deletions
diff --git a/guix/scripts/git/authenticate.scm b/guix/scripts/git/authenticate.scm index e3ecb67c89..d202b6cc7a 100644 --- a/guix/scripts/git/authenticate.scm +++ b/guix/scripts/git/authenticate.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2020, 2024 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2020, 2024, 2025 Ludovic Courtès <ludo@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -134,65 +134,54 @@ REPOSITORY." (define config (repository-config repository)) - ;; Guile-Git < 0.7.0 lacks 'set-config-string'. - (if (module-defined? (resolve-interface '(git)) 'set-config-string) - (begin - (set-config-string config "guix.authentication.introduction-commit" - commit) - (set-config-string config "guix.authentication.introduction-signer" - signer) - (set-config-string config "guix.authentication.keyring" - keyring-reference) - (info (G_ "introduction and keyring recorded \ + (set-config-string config "guix.authentication.introduction-commit" + commit) + (set-config-string config "guix.authentication.introduction-signer" + signer) + (set-config-string config "guix.authentication.keyring" + keyring-reference) + (info (G_ "introduction and keyring recorded \ in repository configuration file~%"))) - (warning (G_ "could not record introduction and keyring configuration\ - (Guile-Git too old?)~%")))) (define (install-hooks repository) "Attempt to install in REPOSITORY hooks that invoke 'guix git authenticate'. Bail out if one of these already exists." - ;; Guile-Git < 0.7.0 lacks 'repository-common-directory'. - (if (module-defined? (resolve-interface '(git)) - 'repository-common-directory) - (let () - (define directory - (repository-common-directory repository)) + (define directory + (repository-common-directory repository)) - (define pre-push-hook - (in-vicinity directory "hooks/pre-push")) + (define pre-push-hook + (in-vicinity directory "hooks/pre-push")) - (define post-merge-hook - (in-vicinity directory "hooks/post-merge")) + (define post-merge-hook + (in-vicinity directory "hooks/post-merge")) - (if (or (file-exists? pre-push-hook) - (file-exists? post-merge-hook)) - (begin - (warning (G_ "not overriding pre-existing hooks '~a' and '~a'~%") - pre-push-hook post-merge-hook) - (display-hint (G_ "Consider running @command{guix git authenticate} + (if (or (file-exists? pre-push-hook) + (file-exists? post-merge-hook)) + (begin + (warning (G_ "not overriding pre-existing hooks '~a' and '~a'~%") + pre-push-hook post-merge-hook) + (display-hint (G_ "Consider running @command{guix git authenticate} from your pre-push and post-merge hooks so your repository is automatically authenticated before you push and when you pull updates."))) - (begin - (call-with-output-file pre-push-hook - (lambda (port) - (format port "#!/bin/sh + (begin + (call-with-output-file pre-push-hook + (lambda (port) + (format port "#!/bin/sh # Installed by 'guix git authenticate'. set -e while read local_ref local_oid remote_ref remote_oid do guix git authenticate --end=\"$local_oid\" done\n") - (chmod port #o755))) - (call-with-output-file post-merge-hook - (lambda (port) - (format port "#!/bin/sh + (chmod port #o755))) + (call-with-output-file post-merge-hook + (lambda (port) + (format port "#!/bin/sh # Installed by 'guix git authenticate'. exec guix git authenticate\n") - (chmod port #o755))) - (info (G_ "installed hooks '~a' and '~a'~%") - pre-push-hook post-merge-hook)))) - (warning (G_ "cannot determine where to install hooks\ - (Guile-Git too old?)~%")))) + (chmod port #o755))) + (info (G_ "installed hooks '~a' and '~a'~%") + pre-push-hook post-merge-hook)))) (define (show-stats stats) "Display STATS, an alist containing commit signing stats as returned by |