From 668b20d59d589cd67716b28336c16cdbe976bcfe Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li <44064051+ShamrockLee@users.noreply.github.com> Date: Wed, 3 May 2023 13:03:01 +0000 Subject: [PATCH 1/2] Revert "git: fix in completion scripts references to environment utils" "git grep" (__gitcomp_builtin grep) is not grep, and thus cannot be substituted by the GNU grep binary. The command patching needs to be done with special care, which includes manual examination of the diff result before and after patching. This reverts commit b5d052d438df99d5a80e7c126551656d5ba74f75. --- pkgs/applications/version-management/git/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index e3dd18e80c2..a296b5fe41a 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -185,7 +185,6 @@ stdenv.mkDerivation (finalAttrs: { # Fix references to the perl, sed, awk and various coreutil binaries used by # shell scripts that git calls (e.g. filter-branch) - # and completion scripts SCRIPT="$(cat <<'EOS' BEGIN{ @a=( @@ -203,8 +202,7 @@ stdenv.mkDerivation (finalAttrs: { EOS )" perl -0777 -i -pe "$SCRIPT" \ - $out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse} \ - $out/share/bash-completion/completions/{git,gitk} + $out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse} # Also put git-http-backend into $PATH, so that we can use smart From b03cc9ce119e686283b3017c7bc0414c635bd044 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li <44064051+ShamrockLee@users.noreply.github.com> Date: Tue, 2 May 2023 19:34:34 +0000 Subject: [PATCH 2/2] Revert "git: also patch the ls command for git-core scripts" Prevent the command patching from breaking the definition of __git_complete_revlist_file, where there's a local varible named "ls" This reverts commit 820dc2a56057bcc396dbddbff6be91e1cec73f6f. --- pkgs/applications/version-management/git/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index a296b5fe41a..9de49f698aa 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -190,8 +190,7 @@ stdenv.mkDerivation (finalAttrs: { @a=( '${gnugrep}/bin/grep', '${gnused}/bin/sed', '${gawk}/bin/awk', '${coreutils}/bin/cut', '${coreutils}/bin/basename', '${coreutils}/bin/dirname', - '${coreutils}/bin/wc', '${coreutils}/bin/tr', - '${coreutils}/bin/ls' + '${coreutils}/bin/wc', '${coreutils}/bin/tr' ${lib.optionalString perlSupport ", '${perlPackages.perl}/bin/perl'"} ); }