How can I search in code of few GitHub repositories within a particular organisation?
IIUC, you could do this to search for code in all repositories of a given organization:
https://github.com/search?q=org%3A<ORG_NAME>+<STRING_TO_SEARCH>&type=Code
for example:
https://github.com/search?q=org%3Abroadcom+main&type=Code
https://github.com/search?q=org%3Aopenwrt+main&type=Code
To limit your search to specific repositories press Advanced Search
after opening above links and fill in In these repositories field.
Related
I'm new to Gitlab API, I know how to create a tag on a specific branch, let's say I have several branches on my repository, and I created several tags on each branch. Now I want get all the tags on a specific branch with GitLabAPI. I've read the Branchs API and Tags API docs carefully, however was unable to find an answer to my question. Please help me out.
I am unsure what you're trying to accomplish as you literally described your problem with one short sentence, so it will be more of a guess.
If what you want to do is to create GitLab tag for a specific commit for a specific branch, you simply do that as you can define branch when creating it. Will not post description of how it should be done as there is documentation.
With GitLabAPI(as you wanted based on you problem description) follow this link:
How to with GitLabAPI
And instead of Release tag just make same steps for any other tag. For tagging from console you should follow this one:
How to with git
If you're looking for a way to find specific tag with GitLabAPI just go that way:
Repository->Tags->Filter by tag name
Tags are unique across the whole repository.
For doing checkout from console:
git checkout <tag>
Your consternation, I believe, comes from misunderstanding the idea of tags. It's kind of a snapshot of repository at specific point, might be for release, may be for backup purposes, does not matter, it's up to you. Important part is that no matter where you will place it, it has to be unique in scope of a whole repository not just a branch you place it. There is no way to create two same tags on two different branches, git won't let you. Read info from links and everything should be clear.
If my answer is not what you were looking for, expand your question to get more proper and accurate one.
I want to list out the popular GitHub repositories for Swift and RXSwift language from GitHub API. Can any one help to get that list.
you can try searching with the search term language:Swift language:and order by stars. Searching is descript https://developer.github.com/v3/search/
The http get request would look like:
https://api.github.com/search/repositories?q=language:Swift+language:RXSwift&sort=stars&order=desc
I'm not sure if this is the right forum for this question. Saw quite a few Q&A related to search on GitHub, hence posting here.
E.g. Search code inside a Github project
GitHub advanced search allows terms like stars:>100 but the query term is restricted to repository names only. Is it possible to search for a term inside the files (code) & sort by stars? My aim is to see which popular repos are using a particular keyword in their code. It would be very useful if GitHub's advanced search options for Repositories worked for Code also.
It is not possible to sort by stars when searching inside code.
From an e-mail from github.com support:
Code search does not support sorting by number of stars, but I will definitely add your +1 to that suggestion internally! I can't say if or when a change will happen, but your feedback is in the right hands.
You may want to vote for this feature: Add Stars count filter.
The feedback is related to this announcement: Improving GitHub code search
How can I search for code fragments on github.com? When I search for MSG_PREPARE in the repository ErikZalm/Marlin github shows up nothing.
I'm using the repository code search syntax described on https://github.com/search with
repo:ErikZalm/Marlin MSG_PREPARE
No results, but MSG_PREPARE can be found inside this repository here. Am I missing something? Is there no code search on github.com?
At the time of writing this answer, compared to time this question was asked i.e. about 8 years ago, github has come a good way, though still not to the length which you are looking at.
GitHub code searches are limited on the following rules: https://docs.github.com/en/github/searching-for-information-on-github/searching-code . Quoting the same:
Code in forks is only searchable if the fork has more stars than the parent repository.
Forks with fewer stars than the parent repository are not indexed for code search.
To include forks with more stars than their parent in the search results, you will need to add fork:true or fork:only to your query.
For more information, see "Searching in forks."
So we can search within the fork using the fork:true option, though as expected, since the repo ErikZalm/Marlin is low on star count as compared to parent MarlinFirmware/Marlin, the code in the fork is still not indexed. Hence the advance search shows no good except a match to the repo.
Though, if you perform the same search on the parent, it would show the matches on the code. Here are the matches for MSG_PREPARE in the parent repo MarlinFirmware/Marlin
Fortunately, one company which I know working on this domain is SourceGraph: https://about.sourcegraph.com/
Hence, you can easily search what you intended with SourceGraph:
Here are the matches for MSG_PREPARE in the ErikZalm/Marlin using SourceGraph Cloud
Update July 2013: "Preview the new Search API"
The GitHub search API on code now supports fragments, through text-match metadata.
Some API consumers will want to highlight the matching search terms when displaying search results. The API offers additional metadata to support this use case. To get this metadata in your search results, specify the text-match media type in your Accept header. For example, via curl, the above query would look like this:
curl -H 'Accept: application/vnd.github.preview.text-match+json' \
https://api.github.com/search/code?q=octokit+in:file+extension:gemspec+-repo:octokit/octokit.rb&sort=indexed
This produces the same JSON payload as above, with an extra key called text_matches, an array of objects. These objects provide information such as the position of your search terms within the text, as well as the property that included the search term.
Original answer (November 2012)
I don't think there is anything that you would have missed.
If you search for SdFile, you would find results in .pde file, but none in cpp files like in this SdFile.cpp file.
The search was introduced 4 years ago (November 2008), but, as mentioned in "Search a github repository for the file defining a given function", GitHub repository code is simply not fully indexed.
When using Advanced Database Crawler for searching in Sitecore is it possible to combine a FieldValueSearchParam with a NumericRangeSearchParam.
For example, I would like to search for all items with a price between 100 and 200 (NumericRangeSearchParam) and in category t-shirts (FieldValueSearchParam).
I can add refinements using RelatedIds and TemplateIds but that is not enough as i need to check if it is in a specific field using:
refinements.Add("category", id);
Yes, all types of search parameters in a combined query are possible with the new version of the ADC, v2
Here are some links to get you started:
SVN source code for the v2 branch (the latest version)
A video by the author, Alex Shyba, on tools he's been working on. At some point in this video he specifically demos the features of the v2 code base and how the code works. One example is him demoing combining different search params and being able to use logical operators like AND and OR with them
Here's a direct link to a demo page (and code behind) in the above referenced source code that shows combining several types of search together. You should use this as a reference to the video example above.