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

[feature-request] Recognize current path when revealing file(s)

Open cybex-dev opened this issue 3 years ago • 3 comments

not a bug., Feature / aesthetic request

What are the steps to reproduce this issue?

  1. git-secret add functions/.runtime.confg
  2. rm functions/.runtime.confg
  3. cd functions
  4. git-secret reveal

What happens?

Failed to detect file(s) at path inside of repo.

What were you expecting to happen?

(detect current path) and reveal file(s)

Any logs, error output, etc?

git-secret: abort: cannot find file to decrypt: /path/to/folder/server/functions/functions/.runtimeconfig.json.secret

Any other comments?

If this feature / addition was considered but ultimately discarded due to sub-directories could have their own secrets, fair enough. On the other hand, being multiple directories in, I could call git add ... successfully, but git-secret (reveal) would not function the same way.

What versions of software are you using?

Operating system: Linux archtower 5.18.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 15 Jul 2022 15:33:02 +0000 x86_64 GNU/Linux

git-secret path: /usr/bin/git-secret

git-secret version: 0.5.0

git version: git version 2.37.1

Shell type and version: GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

gpg version: gpg (GnuPG) 2.2.36

cybex-dev avatar Aug 23 '22 08:08 cybex-dev

I managed to get around this by temporarily creating a secret in the top most folder in the repo and moving it to the desired location. The secret could then be revealed correctly.

It is still, imho, a bug if we follow the Principle of least Astonishment / Don't make me think.

mihaigalos avatar Mar 15 '23 16:03 mihaigalos

After reading this report more carefully, it appears as if git-secret is correct that the file functions/.runtimeconfig.json.secret does not exist because git secret hide was never run

Nevertheless, doing the following should work, we test this automated tests:

git-secret add functions/.runtime.confg git-secret hide # NOTE WE ADDED THIS rm functions/.runtime.confg WE DO NOT CD INTO functions/ git-secret reveal

joshrabinowitz avatar Mar 17 '23 13:03 joshrabinowitz

closing because this cannot be work as expected using steps indicated by OP. See #903 for better bug report about using reval in repo subdirectories, and #905 for a fix (which is in master but has not yet been put into a new release)

joshrabinowitz avatar Mar 17 '23 13:03 joshrabinowitz