New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support reading .gitleaksignore using git show #1249
base: master
Are you sure you want to change the base?
Support reading .gitleaksignore using git show #1249
Conversation
@zricethezav ask humbly to review it 😃 |
78d855a
to
a6de2d0
Compare
I guess it's better to merge after #1250. |
Will rework it accordingly. |
…in and foo of small repo
@zricethezav I've added tests for bare repository, commited With this patch developers now can get an error from #1260 is a nice addition to this MR. |
@zricethezav humbly want to bring your attention here again :) |
Description:
Gitleaks is a cool utility to use as pre-receive hook. It works nice out of box (
--log-opts
option is very handy in this case!), but if developer wants to push some false-positive anyway, there is no way to do it currently. Because Gitleaks trying to read.gitleaksignore
only from current work tree.My patch also allows to read
.gitleaksignore
usinggit show ...
command. Now developer can push both commit with false-positive secret and.gitleaksignore
fix and Giteleaks will omit the problem.Also it introduces new option (only for
detect
command):--gitleaks-ignore-rev
. By default it will point toHEAD
, but in case of pre-receive hooks we could not have HEAD or any other branch yet (totally new, empty repo, or new branch). This option will allow to pass it:I didn't write any additions tests for now, so it's DRAFT. Want to hear some feedback.
Checklist: