Search a github repository for the file defining a given function
Asked Answered
H

1

8

I'd like to search a public repository on github to find where the software defines a given function. It seems this should be straight forward using the advanced search. Not sure if I'm not understanding the filters or if the functions just are not defined.

For example, imagine I want to find where Hadley's facet_wrap function is defined within the ggplot2 repository (it's here.)

I try the advanced search bar selecting Search "Code", written in "R" and enter

facet_wrap repo:ggplot2

And I get no results. Have I formed the query incorrectly?

Heft answered 22/2, 2012 at 19:52 Comment(1)
I had so little luck with GitHub's search function I just imported the project into Eclipse and searched using that.Seibel
D
8

You need user/repo as a search term.

facet_wrap repo:hadley/ggplot2

gives 41 results.

Dilly answered 22/2, 2012 at 20:42 Comment(2)
Interesting. The example code I was originally trying to find though doesn't show up this way. Searching for render_gfm repo:yihui/knitr does not give me results, even though I finally found it manually. Guess the search isn't fully indexed?Heft
Yes I think so; knitr is too young for GitHub to build search index. Just tried saveHTML repo:yihui/animation and it worked.Deadhead

© 2022 - 2024 — McMap. All rights reserved.