Is there a way to grep for partial words inside all code belonging to a GitHub Organization, using the web UI?
Of course, the intent is to avoid having to clone all the organization's repositories and do a local grep; that would be a cumbersome, tedious and error-prone task.
I'm aware of Search code inside a Github project, but I find the search is very misleading as it doesn't really find all results.
For example, I want to find all uses of the string DISABLE_LIBRARIES_GENERATION
in all files from the Kurento organization. Using any of these Advanced Search terms
DISABLE_LIBRARIES_GENERATION user:Kurento
DISABLE_LIBRARIES_GENERATION org:Kurento
yields these results:
${DISABLE_LIBRARIES_GENERATION}
in kms-core/src/server/CMakeLists.txt
.set (DISABLE_LIBRARIES_GENERATION FALSE
in kms-core/CMake/CodeGenerator.cmake
.kms-core/debian/changelog
.-DDISABLE_LIBRARIES_GENERATION=TRUE
as used in adm-scripts/kurento_get_version.sh
, adm-scripts/kurento_generate_js_module.sh
and adm-scripts/kurento_generate_java_module.sh
.state the specific string you're looking for using the "intext:" search operator. add the programming language you're interested in, using the "ext:" operator (i.e. "ext:py", "ext:R", "ext:rb", etc.) search in all public repos in Github using the "site:" operator mrgloom mentioned.
Use quotations around multi-word search terms. For example, if you want to search for issues with the label "In progress," you'd search for label:"in progress" .
Just press T in the repository's directory view and it will let you search for a file.
The answer to my question is: No, it is not currently possible.
Source
I contacted GitHub with this same question, and their response included this explanation:
Currently, we do not support substring matching in our search. We do break words apart for common variable naming patterns like camel case, so if your variable is named something like myNewVariable, you could search for "my new variable" and this would show up.
However, in your example, the string "-DDISABLE_LIBRARIES_GENERATION=TRUE" wouldn't be broken into substrings like this, so "disable_libraries_generation" would not result in a match.
[...] cloning the repository and using grep or another search functionality locally is likely your best option in this case.
UPDATE (2021-12-14)
On December 8, 2021, GitHub announced code search improvements, including "Search for an exact string, with support for substring matches". This is still a technology preview (available here: https://cs.github.com/), but when fully integrated, looks like it might be a satisfactory answer to this question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With