Skip to content
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

Recursive scan is broken #27

Closed
chrisgilmerproj opened this issue May 11, 2016 · 5 comments
Closed

Recursive scan is broken #27

chrisgilmerproj opened this issue May 11, 2016 · 5 comments

Comments

@chrisgilmerproj
Copy link
Contributor

@mtdowling @michaelwittig

See commit 513af41#diff-9bcd3f161947f1bdee06e4b12046cb65

I believe that the recursive function is now broken with the latest commit.

There is a test that shows it should work called Scan recursively:

@test "Scans recursively" {
setup_bad_repo
mkdir -p $TEST_REPO/foo/bar/baz
echo '@todo more stuff' > $TEST_REPO/foo/bar/baz/data.txt
repo_run git-secrets --scan -r $TEST_REPO/foo
[ $status -eq 1 ]
}

And a test named -recursive can only be used with --scan:

@test "-recursive can only be used with --scan" {
repo_run git-secrets --list -r
[ $status -eq 1 ]
}

I think this is broken and should replace --list with --scan as I've done here:

@test "-recursive can only be used with --scan" {
  repo_run git-secrets --scan -r
  [ $status -eq 1 ]
}

But a new test was added to ensure this fails named -recursive is mutual exclusive with --scan:

@test "-recursive is mutual exclusive with --scan" {
repo_run git-secrets --scan -r
[ $status -eq 0 ]
}

Can you clarify that this was intended or fix the broken behavior? Thank you very much.

@michaelwittig
Copy link
Contributor

Correct me if I'm wrong:

git-secrets --scan -r (no file/path given!)

was not working. it always died with "-r|--recursive cannot be supplied with --cached, --no-index, or --untracked". The test -recursive is mutual exclusive with --scan makes sure that this works now. it checks for success rather than error.

The test

@test "-recursive can only be used with --scan" {
repo_run git-secrets --list -r
[ $status -eq 1 ]
}
checks that --list can't be used with -r.

@chrisgilmerproj
Copy link
Contributor Author

I actually can't get this to work in any format. I'm also sorry, I don't have the historical context of whether or not this worked previously.

$  git secrets --scan -r
-r|--recursive cannot be supplied with --cached, --no-index, or --untracked
$  git secrets --scan -r .
-r|--recursive cannot be supplied with --cached, --no-index, or --untracked
$  git secrets --scan -r `pwd`
-r|--recursive cannot be supplied with --cached, --no-index, or --untracked
$  git secrets --scan -r /full/path/to/my/git/repo/
-r|--recursive cannot be supplied with --cached, --no-index, or --untracked

Is there a debug or verbose mode where I can give you more information on what's going on with the internal variables?

Also, we should probably rename the test -recursive can only be used with --scan to --recursive can't be used with --list.

I wasn't clear on how to use the test suite or I would have attempted to submit a patch for this.

@chrisgilmerproj
Copy link
Contributor Author

I take it back, I just figured out how to run the tests with bats. I'll see if I can't figure out what's going on.

@mtdowling
Copy link
Contributor

This issue is now resolved, correct?

@chrisgilmerproj
Copy link
Contributor Author

Yep! Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants