git-secret icon indicating copy to clipboard operation
git-secret copied to clipboard

write debugging tips in docs

Open joshrabinowitz opened this issue 4 years ago • 0 comments

We should put some tricks for debugging (although rarely needed) in the docs.

In particular, I find the trick of running git-secret using bash -x useful. For example, instead of using git secret add file.txt, you can see the steps run using:

    bash -x `which git-secret` add file.txt

which in my case shows output including:

% bash -x `which git-secret` add file.txt
+ GITSECRET_VERSION=0.3.2
+ _SECRETS_DIR=.gitsecret
+ _SECRETS_DIR_KEYS=.gitsecret/keys
+ _SECRETS_DIR_PATHS=.gitsecret/paths
+ _SECRETS_DIR_KEYS_TRUSTDB=.gitsecret/keys/trustdb.gpg
+ _SECRETS_DIR_PATHS_MAPPING=.gitsecret/paths/mapping.cfg
+ [[ -n '' ]]
+ : .secret
+ : gpg
+ : '_os_based __sha256'
+ : '_os_based __get_octal_perms'
+ : '_os_based __epoch_to_date'
+ : /tmp

... <<LOTS OF STUFF REMOVED HERE>> ...

+ already_in=0
+ [[ 0 -eq 1 ]]
+ _message '1 item(s) added.'
+ local 'message=1 item(s) added.'
+ echo 'git-secret: 1 item(s) added.'
git-secret: 1 item(s) added.

We can also describe using SECRETS_VERBOSE env var, and -v option.

See also #465

joshrabinowitz avatar Apr 26 '20 23:04 joshrabinowitz