-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Turns out cmd_grep already greps only through *.gpg files. I don't see
that there's anything to be done with git. The other relevant commands
are cmd_show and cmd_find, which are both using tree. Let me know if
I'm still missing something.

On 01/19/2015 01:17 PM, Jason A. Donenfeld wrote:
> Can you get this rolling also on git grep and anything other
> relevant subcommands?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJU3Pa0AAoJEDAB06W7YBCOSoUH/1vCdO3U0RILSMuYADYMrqkd
NR3nhEiTue+BydnKmbO0aEgDDO8f7Qwv76Rpd9PvPJ8+Aca7s/uvZgehNb0QLcyq
lK+SVuT++ovnr4oH66H9zqHIbrBadjIjyFnVLMhSA+UpGxKMXJX31W+HP2QG28gY
ZlwAJpeHt2VdaKqE1Rn9FrcPYAeol0U11u33OTV21FCQXmsUrcOi6BEGAs2zKOwN
bwaAxN+KEQyHaREseLvp2OVlFG2sQdAmQEaV2tqwv1yfYtELEqFptSF5bpUB+DlD
dBw7LVkJzgCEWZpJ6SrDssZJLTG+MHu3anNhswEudG85bd04QK6R3JsaK1VIuvc=
=x1M0
-----END PGP SIGNATURE-----
From 14ccc3a1945b9f2754309d64fa3e342232c713a2 Mon Sep 17 00:00:00 2001
From: George Angelopoulos <[email protected]>
Date: Thu, 12 Feb 2015 19:46:30 +0100
Subject: [PATCH] show and find only actual password entries (*.gpg)

Password stores might contain things that are not password entries -
for example, a README.md file, if uploaded to a service like GitLab
and used by multiple people. Such a file has no reason to be shown
by "pass show" or "pass find".
---
 src/password-store.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 47f7ffa..6218c6c 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -322,7 +322,7 @@ cmd_show() {
 		else
 			echo "${path%\/}"
 		fi
-		tree -C -l --noreport "$PREFIX/$path" | tail -n +2 | sed 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g' # remove .gpg at end of line, but keep colors
+		tree -C -l --noreport "$PREFIX/$path" -P '*.gpg' | tail -n +2 | sed 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g' # remove .gpg at end of line, but keep colors
 	elif [[ -z $path ]]; then
 		die "Error: password store is empty. Try \"pass init\"."
 	else
@@ -334,7 +334,7 @@ cmd_find() {
 	[[ -z "$@" ]] && die "Usage: $PROGRAM $COMMAND pass-names..."
 	IFS="," eval 'echo "Search Terms: $*"'
 	local terms="*$(printf '%s*|*' "$@")"
-	tree -C -l --noreport -P "${terms%|*}" --prune --matchdirs --ignore-case "$PREFIX" | tail -n +2 | sed 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g'
+	tree -C -l --noreport -P "${terms%|*}.gpg" --prune --matchdirs --ignore-case "$PREFIX" -P '*.gpg' | tail -n +2 | sed 's/\.gpg\(\x1B\[[0-9]\+m\)\{0,1\}\( ->\|$\)/\1\2/g'
 }
 
 cmd_grep() {
-- 
2.3.0

Attachment: 0001-show-and-find-only-actual-password-entries-.gpg.patch.sig
Description: PGP signature

_______________________________________________
Password-Store mailing list
[email protected]
http://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to