Reveal verbose (#447)

* add -v option to reveal, for #395
* update reveal man page
* shellcheck exception
* changelog update for 'reveal -v'
pull/440/head^2
Josh Rabinowitz 5 years ago committed by GitHub
parent 07af0c19b6
commit 8334d7beef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,7 +8,7 @@
- Support automated testing on windows with Travis CI (#372)
- Support SECRETS_VERBOSE env var to enable verbosity (#323)
- Use gpg without --quiet when decrypting in verbose mode (#394)
- Add -v 'verbose' option to 'tell', showing gpg output (#320)
- Add -v options to 'tell' and 'reveal', showing gpg output (#320, #395)
- Change 'init' to never ignore .secret files (#362)
- 'add' appends filepaths to .gitignore by default (#225)
- Automate the GitHub release (#411)

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "GIT\-SECRET\-REVEAL" "1" "February 2019" "sobolevn" "git-secret"
.TH "GIT\-SECRET\-REVEAL" "1" "March 2019" "sobolevn" "git-secret"
.
.SH "NAME"
\fBgit\-secret\-reveal\fR \- decrypts all added files\.
@ -10,7 +10,7 @@
.
.nf
git secret reveal [\-f] [\-F] [\-P] [\-d dir] [\-p password] [pathspec]\.\.\.
git secret reveal [\-f] [\-F] [\-P] [\-v] [\-d dir] [\-p password] [pathspec]\.\.\.
.
.fi
.
@ -27,6 +27,7 @@ git secret reveal [\-f] [\-F] [\-P] [\-d dir] [\-p password] [pathspec]\.\.\.
\-f \- forces gpg to overwrite existing files without prompt\.
\-F \- forces reveal to continue even if a file fails to decrypt\.
\-d \- specifies `\-\-homedir` option for the `gpg`, basically use this option if you store your keys in a custom location\.
\-v \- verbose, shows extra information\.
\-p \- specifies password for noinput mode, adds `\-\-passphrase` option for `gpg`\.
\-P \- preserve permissions of encrypted file in unencrypted file\.
\-h \- shows help\.

@ -3,7 +3,7 @@ git-secret-reveal - decrypts all added files.
## SYNOPSIS
git secret reveal [-f] [-F] [-P] [-d dir] [-p password] [pathspec]...
git secret reveal [-f] [-F] [-P] [-v] [-d dir] [-p password] [pathspec]...
## DESCRIPTION
@ -22,6 +22,7 @@ folder using the SECRETS_DIR environment variable.
-f - forces gpg to overwrite existing files without prompt.
-F - forces reveal to continue even if a file fails to decrypt.
-d - specifies `--homedir` option for the `gpg`, basically use this option if you store your keys in a custom location.
-v - verbose, shows extra information.
-p - specifies password for noinput mode, adds `--passphrase` option for `gpg`.
-P - preserve permissions of encrypted file in unencrypted file.
-h - shows help.

@ -10,7 +10,9 @@ function reveal {
OPTIND=1
while getopts 'hfFPd:p:' opt; do
while getopts 'hfFPd:p:v' opt; do
# line below is for _SECRETS_VERBOSE
# shellcheck disable=SC2034
case "$opt" in
h) _show_manual_for 'reveal';;
@ -24,6 +26,8 @@ function reveal {
d) homedir=$(_clean_windows_path "$OPTARG");;
v) _SECRETS_VERBOSE=1;;
*) _invalid_option_for 'reveal';;
esac
done

@ -54,6 +54,16 @@ function teardown {
[ -f "$FILE_TO_HIDE" ]
}
@test "run 'reveal' with '-v'" {
rm "$FILE_TO_HIDE"
local password=$(test_user_password "$TEST_DEFAULT_USER")
run git secret reveal -v -d "$TEST_GPG_HOMEDIR" -p "$password"
[ "$status" -eq 0 ]
[ -f "$FILE_TO_HIDE" ]
}
@test "run 'reveal' with '-P'" {
rm "$FILE_TO_HIDE"

Loading…
Cancel
Save