hound-search / hound Goto Github PK
View Code? Open in Web Editor NEWLightning fast code searching made easy
License: MIT License
Lightning fast code searching made easy
License: MIT License
Here's an example:
http://localhost:6080/[email protected]:Internetworkexpert/Members-Dash/blob/master/assets/bower_components/bootstrap/less/type.less#L114
Naturally you won't be able to see the original on github, because it's private.
When entering an invalid regex (
it will freeze the tab.
Edit: Including an empty search term.
Google Chrome
Version 40.0.2214.93 (64-bit)
OSX 10.9.5
I'm not a fan of using Rake as a replacement for a simple make or simple bash. But to illustrate a point similar to the go authors... using go to compile go. Here is a Gist that you are welcome to incorporate into your project. I will adhere to whatever license you prefer:
Two questions:
config.json
{
"dbpath" : "data",
"repo-type": "local",
"repos" : {
"SomeRepo" : {
"url" : "/MyRepositories/SomeRepo"/MyRepositories/AnotherRepo"
},
"AnotherRepo" : {
"url" : "
}
}
}
Add symlink
~/Hound/data symlinks to ~/MyRepositories/
version: 8.0.2 (10600.2.5)
Beachballs in Safari :/ Works like a charm in Chrome.
Howdy folks,
This project looks cool. Nice idea and execution.
I work at thoughtbot. We've run a product, also called Hound, for a year or so. It is a hosted Continuous Integration service to check code style on GitHub pull requests. It is also open source.
We've noticed a number of people expressing confusion over the conflicting "Hound" name for code-related tools:
Would you mind changing the name of this project to something else?
Happy to chat over email if that's easier, too. [email protected].
Dan
Setting up Hound locally now, but its unclear from the README when does the indexer actually run after the first indexing. It should be configurable, I think.
Does this support indexing local repositories?
The example config has a url
key, but can I use, say path
and set the value to a folder on my machine?
We're searching 100+ repositories and would like to be able to tag repos. Then we can restrict searches to repos with a given tag. Here's what I imagine the config could look like. Happy to give this a go, but would appreciate some input on where to get started.
"SomeGitRepo" : {
"url" : "https://www.github.com/YourOrganization/RepoOne.git",
"tags" : ["client-1", "ruby"]
}.
"SomeRubyRepo" : {
"url" : "https://www.github.com/YourOrganization/RepoOne.git",
"tags" : ["client-1", "objective-c"]
}
This is related to #7 in that when I removed the copy of code.google.org/p/codesearch, everything broke as the version that's public doesn't have *Index.Close()
Should this library be forked or something like that so we can make the project go-gettable?
It would be nice if Hound supports a simple query language like "firstTerm !secondTerm" (search files including "firstTerm", but not "secondTerm"). Narrowing down a search with the regex file path works fine, but sometimes I want to search for specific filenames and match files that I have not yet modified (for example, adding a plugin to several POMs).
Having a simple query like the one above combined with the regex file path would allow me to search for those files. Using AND, OR, NOR, XOR would also be possible.
Do you think this is feasible and in line with the direction you want Hound to move?
Since it is broken in that case.
One of my github projects is an empty repository at the moment. The houndd/main.go
crashes every time it tries to scan it:
go run src/hound/cmds/houndd/main.go (no jobs) [master] Week 05 29.01.15 13:53
2015/01/29 13:54:00 Searcher started for gol
panic: exit status 1
goroutine 1 [running]:
main.main()
/tmp/Hound/src/hound/cmds/houndd/main.go:304 +0x5a6
exit status 2
Please integrate a check for empty repositories.
I tried to stick commands between them, that didn't work.
Any recommendations on how to deploy somewhere.
Tabbing allows you to type into the File Path without seeing what you're typing because the filter doesn't show when the File Path input field gets focus from tab.
Does this support two factor authentication for github?
I'm setting up Hound to run against about 3000 Stash repos (PR coming to handle the different file link format) and noticed that a small number of repos weren't indexed properly the first time. As soon as Hound finds a bad index, it immediately shuts down.
Deleting the source code and index for each repo and letting Hound re-clone and reindex seemed to work every time.
I'd prefer not to have Hound exit as soon as it finds a bad index, but log a severe error instead. Rather than submitting a PR for this behaviour, I wanted to check what other people think first - maybe the option should be configurable for example ?
Is it possible to add directories/files to be excluded as a optional config option?
Something like:
"repos" : {
"myrepo" : {
"url" : "file:///Users/Me/projects/Project",
"exclude_patterns": ["tests"]
}
}
Since this project can be built into a single binary, it would be great it could be downloaded without having to have any build environemnt
A small info page that could list all the repos configured to be searchable. So that others can have a look and recommend additions.
We have a mixture of UTF8 and UTF16 files. Hound seems to search them correctly, as in it will say 16 files searched, but only show 4. When I go and manually switch save as UTF8 and check in then the files will show in the UI.
When click on a file that has been pulled from bitbucket it uses the URL that works for github which is slightly different than bitbucket's.
"blob/master" for github
"src/master" is needed for bitbucket
I tried following the instruction by doing the following:
git clone [email protected]:etsy/Hound.git
cd Hound
go get github.com/etsy/hound/cmds/houndd
houndd
However, I got this error bash: houndd: command not found
. I am not familiar with go at all, so I am not sure what I am doing wrong. Could someone point me in the right direction?
It would be really helpful if you could just tell it to search/index all the repositories under a namespace. With some organisations having hundreds of repo's needing to explicitly define every single one of them is needless work.
If it's only for repo's on Github it could be automated through the Github API.
After clone your repo and configure the config file I run make and it stops with that error on Ubuntu 12.04
make
GOPATH=pwd
go build -o bin/houndd src/hound/cmds/houndd/main.go
hound/index
src/hound/index/grep.go:64: function ends without a return statement
src/hound/index/grep.go:137: function ends without a return statement
make: *** [bin/houndd] Fehler 2
When loading Hound in internet explorer 11 nothing appears.
Is there private repo support? How does one configure it?
If not, it'd be a great feature to have!
@jdan suggested it on HN a few minutes ago.
Would be great to support a RESTful API to support native front ends.
Hey,
What does the button next to each hit do? Can you add some mouseover text so we know.
Looks like a clipboard. Is it "copy to clipboard"? Doesn't seem to work if so.
Thanks
If I have a folder containing all my repos (local or on shared network space using gitlab or similar) the entire directory contains sub directories of different git repos. If I want to index all of the repos, including newly added repos, I would hope to be able to use the following config to index all of the repos at once.
{
"repos" : {
"gitlab" : {
"url" : "file://path/to/repos/"
"recurse" : "true"
}
}
}
This would hopefully help with managing dozens or hundreds of repos needing to be put into a config.json file.
Is there a way to configure the format/pattern of the URL where the results are linked to? It works fine with gitlab and github, but with stash, another format is expected:
https://mystash.tld/projects/PROJECT/repos/REPO/browse/common/src/main/...
src/hound/index/grep.go:64: function ends without a return statement
src/hound/index/grep.go:137: function ends without a return statement
any config example?
Hound is super-simple to get running, which is awesome! I'm trying to index a number of repos on a host that's got lots of disk, but little memory. (1GB... I know. I want to increase that but can't at the moment for Reasons.) The indexer runs for a brief period and then hits a panic:
panic: fork/exec /usr/bin/git: cannot allocate memory
My currently configured repos (100 of em) are just a small fraction of the total I'd like to index. I'll be moving to a different host, but I'm wondering if you have any rough rules of thumb for resource requirements. Obviously this is very repo dependent, but perhaps something normalized like a ratio of source repo size on disk to index size and indexer memory requirements?
Hi again,
Do you plan to integrate hound into editors? Currently you have to leave my editor, visit a web page, and when you click a hit, you are taken to a github page. It would be nice if users could harness hound in their editor of choice: vim/emacs/eclipse/whatever.
I am a vim user, so I imagine a use case where I can type :hound <search_term>
, then a pane would show hits, which I could select from a list to open them as buffers. The ack vim plugin (which is what I currently use) works like this.
I'm not sure how you would account for local edits though.
Quite an ambitious proposal I know, but have you thought about it? Maybe it is too much effort...
Thanks
I can load http://localhost:6080/ in Safari, but not in Firefox 35.0.1 on a Mac saying the connection has timed out. Could be my system at fault here...
It'd be great if you could specify a branch to use for searching in the config. It'd be even better if you could do it on the fly in the UI
Have you considered adding support for syntax highlighting? This is complicated by the fact that each line is displayed separately. It seems like it would be much simpler to just show all the code inside a <pre>
tag and then use something like google-code-prettify to add line numbers and syntax highlighting. Then just apply the highlighting on the generated HTML using something like the jQuery highlight plugin.
Enhancement suggestion:
I would like Hound to work with repos that are already on my server, without cloning them first. This is for an in-house repo hosting server, for example.
Please make it go get-able
2015/02/03 14:30:04 Searcher started for ABC-Project
2015/02/03 14:30:04 Failed to clone file://abc/project, see output below
Cloning into 'ABC-Project'...
fatal: '/abc/project' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Continuing...
2015/02/03 14:30:04 Some repos failed to index, see output above
2015/02/03 14:30:04 running server at http://localhost:6080...
The folder exists and I have the access right since I'm running it as root.. It's just that it is local mercurial
repo instead of git
.. I am using commit d2c1d98
Currently Hound only supports HTTP style URLs for repos, and it would be nice to support SSH as well.
I ran hound using
go run src/hound/cmds/houndd/main.go
Works fine for a while. Then, I see this in my console—
2015/01/29 14:50:23 Rebuilding fs-scoring for efa7db02762ad04355539f65b1b7a8e7e33b9bbe
2015/01/29 14:50:26 merge 0 files + mem
2015/01/29 14:50:26 2470307 data bytes, 478302 index bytes
HeapInUse = 4.84
HeapIdle = 473.31
And after that, searching for anything gives messages like these—
ERROR:open /home/aphatarpekar/setups/Hound/data/questionnaire-service-50fab2c00d1251d2b020a4776de59359405285aa/raw/pom.xml: no such file or directory
I am completely new to go so I am not sure what I'm doing wrong, but I got this error trying to build the docker image. Could anyone help?
Step 1 : COPY src /go/src
INFO[0000] src: no such file or directory
I have no idea what this means:
2015/01/27 17:13:05 Searcher started for inventory
panic: exit status 128
goroutine 1 [running]:
main.main()
/Users/erichanchrow/git-repositories/3rd-party/Hound/src/hound/cmds/houndd/main.go:304 +0x5a6
goroutine 6 [sleep]:
hound/searcher.func·001()
/Users/erichanchrow/git-repositories/3rd-party/Hound/src/hound/searcher/searcher.go:145 +0x6f
created by hound/searcher.New
/Users/erichanchrow/git-repositories/3rd-party/Hound/src/hound/searcher/searcher.go:183 +0x54b
exit status 2
I found that deleting the relevant entries from my config file allowed it to continue. (There were maybe half a dozen URLs that causes crashes like this).
Just going to the hound base url gives the error "ERROR:search exceeds limit on matches: 5000" because Safari seems to send the query to the server in this case.
When searching I received errors of the form:
ERROR:open <path to missing file>: no such file or directory
I think this is due to the expungeOldIndexes function in searcher.go
If, for example, you have two projects: 'my-project' and 'my-project-tests', indexing of 'my-project' removes directories matching 'my-project-', which includes the directories for 'my-project-tests'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.