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

Adding the option --repos-without-matches #356

Closed

Conversation

djgoku
Copy link

@djgoku djgoku commented Jan 5, 2025

--repos-without-matches returns all repositories not containing a match. It is the inverse of what --repos-with-matches returns. Example all-repos-grep some-text-not-in-repos --repos-without-matches.

@asottile thanks for all the software you write!

Not sure if this is something you have wanted or needed. I will say I did add repos-without-matches as an option to all-repos-find-files but it isn't returning repositories not containing a searched file e.g.: all-repos-find-files .gitignore --repos-without-matches.

djgoku and others added 2 commits January 4, 2025 18:39
This will return all repositories not containing a match. It is the
inverse of what `--repos-with-matches` returns.
@asottile
Copy link
Owner

asottile commented Jan 5, 2025

I had previously rejected this but I'm not quite sure where so I'll reiterate the problems here:

  • this breaks --repos prefix matching (I actually didn't even know the argument was --repos-with-matches tbh!)
  • there's existing ways to accomplish the same thing (repos without root .gitignore might be something like all-repos-list-repos --output-paths | xargs --replace bash -c 'test -f {}/.gitignore || echo {}', repos with pre-commit config not containing flake8 all-repos-grep --repos -L flake8 -- .pre-commit-config.yaml, etc.)
  • it's sort of ambiguous with all-repos-grep -L so I'd rather not introduce a confusing option

@asottile asottile closed this Jan 5, 2025
@djgoku djgoku deleted the feature/add-repos-without-matches-to-grep branch January 5, 2025 01:08
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

Successfully merging this pull request may close these issues.

2 participants