GNU bug report logs - #66171
[PATCH] gnu: git: Install shell completions.

Previous Next

Package: guix-patches;

Reported by: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Date: Sat, 23 Sep 2023 19:46:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: Efraim Flashner <efraim <at> flashner.co.il>, 66171 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [bug#66171] [PATCH v3] gnu: git: Install zsh completions and git-prompt.
Date: Sun, 01 Oct 2023 23:34:56 -0400
Hi Liliana,

Liliana Marie Prikler <liliana.prikler <at> gmail.com> writes:

> * gnu/packages/version-control.scm (git)[#:phases]<install-shell-completion>:
> Also install git-prompt and zsh _git site function.
> ---
>  gnu/packages/version-control.scm | 15 ++++++++++-----
>  1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
> index 9716a6f27a..d8c9bf4009 100644
> --- a/gnu/packages/version-control.scm
> +++ b/gnu/packages/version-control.scm
> @@ -448,12 +448,17 @@ (define-public git
>                       "DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl")))
>           (add-after 'install 'install-shell-completion
>             (lambda* (#:key outputs #:allow-other-keys)
> -             (let* ((out         (assoc-ref outputs "out"))
> -                    (completions (string-append out "/etc/bash_completion.d")))
> -               ;; TODO: Install the tcsh and zsh completions in the right place.
> -               (mkdir-p completions)
> +             (let* ((out  (assoc-ref outputs "out"))
> +                    (bash (string-append out "/etc/bash_completion.d"))
> +                    (zsh  (string-append out "/share/zsh/site-functions")))
> +               ;; TODO: Install the tcsh completions in the right place.
> +               (for-each mkdir-p (list bash zsh))
>                 (copy-file "contrib/completion/git-completion.bash"
> -                          (string-append completions "/git")))))
> +                          (string-append bash "/git"))
> +               (copy-file "contrib/completion/git-prompt.sh"
> +                          (string-append out "/bin/git-prompt"))
> +               (copy-file "contrib/completion/git-completion.zsh"
> +                          (string-append zsh "/_git")))))
>           (add-after 'install 'install-credential-netrc
>             (lambda* (#:key outputs #:allow-other-keys)
>               (let* ((netrc (assoc-ref outputs "credential-netrc")))

Sorry if my previous reply was not clear, but with your clarifications I
think it'd be best to keep the 'contrib' output, perhaps documenting in
the description that it contains the 'git-prompt' command as well as
completions for Zsh?

-- 
Thanks,
Maxim




This bug report was last modified 1 year and 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.