Bug#892110: please ignore all .git files in zsh autocompletion

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bug#892110: please ignore all .git files in zsh autocompletion

Evgeni Golov-2
Package: pass
Version: 1.7.1-3
Severity: wishlist
Tags: upstream patch

Ohai,

pass git init creates a .gitattributes file, but that is not excluded
from the zsh completion file, resulting in a "stray" password being
shown.

the following patch should fix it :)

--- /tmp/_pass 2018-03-05 17:57:07.364909210 +0100
+++ /usr/share/zsh/vendor-completions/_pass 2018-03-05 17:57:44.113224814 +0100
@@ -124,7 +124,7 @@
  local IFS=$'\n'
  local prefix
  zstyle -s ":completion:${curcontext}:" prefix prefix || prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}"
- _values -C 'passwords' ${$(find -L "$prefix" \( -name .git -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort):-""}
+ _values -C 'passwords' ${$(find -L "$prefix" \( -name .git\* -o -name .gpg-id \) -prune -o $@ -print 2>/dev/null | sed -e "s#${prefix}/\{0,1\}##" -e 's#\.gpg##' -e 's#\\#\\\\#' | sort):-""}
 }
 
 _pass_complete_entries_with_subdirs () {

and yes, this should go upstream, I was just too lazy to join their mailinglist.

Evgeni

-- System Information:
Debian Release: buster/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: SELinux: enabled - Mode: Permissive - Policy name: default

Versions of packages pass depends on:
ii  gnupg   2.2.5-1
ii  gnupg2  2.2.5-1
ii  tree    1.7.0-5

Versions of packages pass recommends:
ii  git       1:2.16.2-1
ii  gnupg2    2.2.5-1
ii  qrencode  3.4.4-1+b2
ii  xclip     0.12+svn84-4+b1

Versions of packages pass suggests:
ii  libxml-simple-perl  2.24-1
ii  perl                5.26.1-5
ii  python              2.7.14-4
ii  python3             3.6.4-1
ii  ruby                1:2.5.0

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/zsh/vendor-completions/_pass (from pass package)