@@ -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"))