Skip to content

Commit

Permalink
tig: Don't install the broken ZSH completion
Browse files Browse the repository at this point in the history
There are some Nixpkgs specific issues that we could fix but due to
changes in Git it currently isn't possible to source git-completion.bash
from ZSH (at least not how tig-completion.bash expects it).
Upstream issue: jonas/tig#940

For the meantime it seems best to simply not install it anymore so that
the fallback implementation from ZSH can be used (more inaccurate as the
git-log completion is reused but it is helpful to complete remotes,
branches, tags, etc. and doesn't emit an error to the console).
  • Loading branch information
primeos authored and ian bierlich committed Sep 14, 2020
1 parent 6c13c36 commit b2d3715
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ stdenv.mkDerivation rec {
# fixes tig-completion __git-complete dependency
sed -i '1s;^;source ${git}/share/bash-completion/completions/git\n;' contrib/tig-completion.bash
substituteInPlace contrib/tig-completion.zsh \
--replace 'e=$(dirname ''${funcsourcetrace[1]%:*})/tig-completion.bash' "e=$out/share/bash-completion/completions/tig"
install -D contrib/tig-completion.bash $out/share/bash-completion/completions/tig
install -D contrib/tig-completion.zsh $out/share/zsh/site-functions/_tig
cp contrib/vim.tigrc $out/etc/
# Note: Until https://github.com/jonas/tig/issues/940 is resolved it is best
# not to install the ZSH completion so that the fallback implemenation from
# ZSH can be used (Completion/Unix/Command/_git: "_tig () { _git-log }"):
#install -D contrib/tig-completion.zsh $out/share/zsh/site-functions/_tig
wrapProgram $out/bin/tig \
--prefix PATH ':' "${git}/bin"
'';
Expand Down

0 comments on commit b2d3715

Please sign in to comment.