[pass] [PATCH] Remind users to add files on init

milki milki at rescomp.berkeley.edu
Mon Sep 17 09:45:35 CEST 2012


Use git status to show users any existing password files in the case
password files are created before git init
---
 src/password-store.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 0a12d67..e478f54 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -345,7 +345,16 @@ case "$command" in
 		fi
 		;;
 	git)
-		if [[ $1 == "init" || -d $GIT ]]; then
+		if [[ $1 == "init" ]]; then
+			git init
+			echo .gpg-id > $PREFIX/.gitignore
+			echo .gitignore >> $PREFIX/.gitignore
+
+			untracked=$(git status --porcelain | grep ^? | wc -l)
+			if [[ "$untracked" -ne 0 ]]; then
+				git status
+			fi
+		elif [[ -d $GIT ]]; then
 			exec git "$@"
 		else
 			echo "Error: the password store is not a git repository."
-- 
1.7.11.5




More information about the Password-Store mailing list