From patchwork Sat Sep 23 19:43:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Liliana Marie Prikler X-Patchwork-Id: 54242 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CA6E127BBE9; Sat, 23 Sep 2023 20:46:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C0E7A27BBE2 for ; Sat, 23 Sep 2023 20:46:14 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qk8Zc-0003LH-Pj; Sat, 23 Sep 2023 15:45:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qk8Zb-0003L9-Ia for guix-patches@gnu.org; Sat, 23 Sep 2023 15:45:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qk8Zb-0002Lj-AL for guix-patches@gnu.org; Sat, 23 Sep 2023 15:45:51 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qk8Zm-00033w-9b for guix-patches@gnu.org; Sat, 23 Sep 2023 15:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66171] [PATCH] gnu: git: Install shell completions. Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 23 Sep 2023 19:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66171 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66171@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169549830411679 (code B ref -1); Sat, 23 Sep 2023 19:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Sep 2023 19:45:04 +0000 Received: from localhost ([127.0.0.1]:40667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qk8Yq-00032I-3i for submit@debbugs.gnu.org; Sat, 23 Sep 2023 15:45:04 -0400 Received: from lists.gnu.org ([2001:470:142::17]:55690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qk8Yl-00031T-SJ for submit@debbugs.gnu.org; Sat, 23 Sep 2023 15:45:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qk8YU-0003H1-Ps for guix-patches@gnu.org; Sat, 23 Sep 2023 15:44:42 -0400 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qk8YS-0001vX-Us for guix-patches@gnu.org; Sat, 23 Sep 2023 15:44:42 -0400 Received: by mail-ej1-x644.google.com with SMTP id a640c23a62f3a-9adb9fa7200so978137566b.0 for ; Sat, 23 Sep 2023 12:44:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695498278; x=1696103078; darn=gnu.org; h=to:content-transfer-encoding:mime-version:subject:date:from :message-id:from:to:cc:subject:date:message-id:reply-to; bh=keyLN0IrQN2qxVdOdKn2dO5sSACp6G78JT5XQzio9YI=; b=GlQH+vBJPp1u7329y3ui7qURethHYip4kdz8OLCs0vrY/OeU1fti7VHv2+vTAxyuIZ ucAowH9G1BeJrgXR+8hMVFGM3IL+ojS1VaW27jN5o+iX0q1eKPArgASJKMEzVBv4koEK BmE25UVamjM+zdReDYKs48TUQReHjfIJWKhd04HiuCtsZZur4W8XXpx8qx1ZzAgw6Q3u MNXh4aWRu2yWp04MUXKkGYLWcp8vecPUxTgqmLmzfa6un9Fq2DziPABjKyL8zTWmDZch RFM88cFuTpSnixdFb8lr74+EFapKlgirFh2ypA/g9MTOb9AYMB6qgNbH23InEPUBnhu3 ctlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695498278; x=1696103078; h=to:content-transfer-encoding:mime-version:subject:date:from :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=keyLN0IrQN2qxVdOdKn2dO5sSACp6G78JT5XQzio9YI=; b=rTeqCL1TS4FmCyctLeq+Iwx7LXwynydZCzELycV/NBoPSOJYyXvdvjVoXDOHjjxlNC qcka5HCEOb0Nzl3fjp8NvaX4Qvj3VScckLDXL7sAo9UhHPcXNxRnSE+0CQOJNSXyC+2S axtVmlor0pBKsbLhaNn3atPQtZ2AXm7bbloV4HG7onu3Vvu7ir4IpvqoolQsV3j0pR4X qU0PO417Dgxa2/xOIOyEmqH3B+1Dkwa6uUeM9Z3JSvnjzH/XH4FmtErV/a9Gd8ZvmpDx qhXYtL4T6PObWTZndMWm2fxk0wLv5+UI+/uNlllGVmLByQ5mSSuP1Um87/6H8x82sAMx taww== X-Gm-Message-State: AOJu0YwtCKWd6Q6BpEr+U8vTCs469VvfM4IBFUp+NChY9GPsGWBDP2La 5DtCDSoN2FIHaUdW2m8Oep5Doqgw9oOsXuXK X-Google-Smtp-Source: AGHT+IHlCF8WGxZda2Jr8aKPPTwxoN2/JUR4qZznNepmJA7I3s63aVgJ/GFDTqxp8URo34KK3VrJWQ== X-Received: by 2002:a17:907:868f:b0:9a5:962c:cb6c with SMTP id qa15-20020a170907868f00b009a5962ccb6cmr9946032ejc.31.1695498278192; Sat, 23 Sep 2023 12:44:38 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id ha26-20020a170906a89a00b009930308425csm4238319ejb.31.2023.09.23.12.44.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 12:44:36 -0700 (PDT) Message-ID: From: Liliana Marie Prikler Date: Sat, 23 Sep 2023 21:43:07 +0200 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::644; envelope-from=liliana.prikler@gmail.com; helo=mail-ej1-x644.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/version-control.scm (git)[outputs]: Add “completion”. [#:phases]: Add ‘install-completion’. --- gnu/packages/version-control.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) base-commit: 4f35ff1275e05be31f5d41464ccf147e9dbfd016 prerequisite-patch-id: ee5d7299c5790d77e0d409f34165063fcff10a8b 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"))