From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 66171@debbugs.gnu.org
Subject: [bug#66171] [PATCH] gnu: git: Install shell completions.
Date: Sat, 23 Sep 2023 21:43:07 +0200 [thread overview]
Message-ID: <e5452a70381443c07400cabf7f8c098cdb9849bf.1695498272.git.liliana.prikler@gmail.com> (raw)
* gnu/packages/version-control.scm (git)[outputs]: Add “completion”.
[#:phases]: Add ‘install-completion’.
---
gnu/packages/version-control.scm | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 9716a6f27a..54b2ed74fb 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -303,6 +303,7 @@ (define-public git
"credential-netrc" ; git-credential-netrc
"credential-libsecret" ; git-credential-libsecret
"subtree" ; git-subtree
+ "completion" ; git-completion and git-prompt
"gui")) ; gitk, git gui
(arguments
`(#:make-flags `("V=1" ;more verbose compilation
@@ -482,6 +483,20 @@ (define-public git
(string-append subtree "/bin"))
(install-file "contrib/subtree/git-subtree.1"
(string-append subtree "/share/man/man1")))))
+ (add-after 'install 'install-completion
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((completion (assoc-ref outputs "completion")))
+ (define (install-as file storename)
+ (let ((storename (string-append completion storename)))
+ (mkdir-p (dirname storename))
+ (copy-file file storename)))
+ (with-directory-excursion "contrib/completion"
+ (for-each (cut apply install-as <>)
+ `(("git-prompt.sh" "/bin/git-prompt")
+ ("git-completion.bash"
+ "/share/bash-completion/completions/_git")
+ ("git-completion.zsh"
+ "/share/zsh/site-functions/_git")))))))
(add-after 'install 'restore-sample-hooks-shebang
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
base-commit: 4f35ff1275e05be31f5d41464ccf147e9dbfd016
prerequisite-patch-id: ee5d7299c5790d77e0d409f34165063fcff10a8b
--
2.41.0
next reply other threads:[~2023-09-23 19:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-23 19:43 Liliana Marie Prikler [this message]
2023-09-23 19:43 ` [bug#66171] [PATCH v2] gnu: git: Install shell completions Liliana Marie Prikler
2023-09-25 17:51 ` [bug#66171] [PATCH] " Maxim Cournoyer
2023-09-25 18:41 ` Liliana Marie Prikler
2023-09-26 16:36 ` Maxim Cournoyer
2023-09-28 14:41 ` Efraim Flashner
2023-09-23 19:43 ` [bug#66171] [PATCH v3] gnu: git: Install zsh completions and git-prompt Liliana Marie Prikler
2023-10-02 3:34 ` Maxim Cournoyer
2023-10-02 4:30 ` Liliana Marie Prikler
2023-10-02 9:12 ` Efraim Flashner
2023-10-04 0:35 ` Maxim Cournoyer
2023-10-10 3:33 ` bug#66171: " Maxim Cournoyer
2023-09-25 11:12 ` [bug#66171] [PATCH] gnu: git: Install shell completions Simon Tournier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e5452a70381443c07400cabf7f8c098cdb9849bf.1695498272.git.liliana.prikler@gmail.com \
--to=liliana.prikler@gmail.com \
--cc=66171@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.