From: Edward P. <ho...@gm...> - 2009-07-31 03:55:54
|
hey all, I was looking for a couple of things wrt cscope: 1. Is there a grep interface for cscope? I'd like the same interface as grep, ie: cscope -l <pattern> gives a list of files matching a certain pattern, cscope -C 3 gives 3 lines of context, etc. 2. How big a database does it generate (correlated to size of input)? 3. Is there an 'update' mode? ie: if I give it a list of files to index, and then have it index a second time, can you configure it only to take the deltas for the new and changed files? 4. How well does it do on large, arbitrary text (as opposed to code) Can you configure it for to handle both? Thanks much for any info, I'd love to use it, but doing so would be dependent on whether or not the above features are supported... Thanks much, Ed |
From: Edward P. <ho...@gm...> - 2009-07-31 05:42:48
|
btw... I'm getting the following errors when I try to index: cscope: cannot create inverted index; ignoring -q option cscope: removed files ncscope.in.out and ncscope.po.out what would cause this? I appreciate the error, but it gives very little feedback on exactly why this given error is occurring. Thanks, ed |
From: Edward P. <ho...@gm...> - 2009-07-31 22:55:26
|
> Depends on what exactly you expect from such a thing. No, cscope doesn't > try to imitate grep. That's what grep itself is for. There is a > command-line, single-shot mode though. See option -L in the manpage. grep works horribly for large projects - especially for NFS - but is in turn very useful for searching files. cscope has (or could have with the right algorithms) a much faster way of looking through a large project (plaintext or not), but in turn requires extra space. If you have this extra space, don't you see how this could be a exceedingly useful thing to have? Think 'locate' except for text. > >> 4. How well does it do on large, arbitrary text (as opposed to code) > > It doesn't. This is cscope, not Google. think it through a bit. Even open source code search engines have plaintext search; say I don't know a given function (or class, etc) but I know a comment that I used. Any complete code searching engine should have the ability to search very quickly for arbitrary text. And if it has the ability to look for arbitrary text in code, it could easily be made into a generic indexing engine, so you get a fully new functional area for free. But anyways, since it sounds like cscope has decided on its boundaries, let me rephrase the question - is anyone aware of an open source indexer that can do this? It should be able to index arbitrary text for sub-linear pattern matching. Ed |
From: Edward P. <ho...@gm...> - 2009-08-02 15:52:07
|
> cscope is a tool for a very specific purpose, and a good part of its power > comes from limiting itself to that. The majority of cscope's features would > make no sense whatsoever for a general-purpose search engine. When have you > last wanted to find functions called by function <name> in an accounting > report? No.. I'm not thinking that - of course cscope should retain the ability to find function names, class names, etc and that it should retain that ability easily.. What gave you the idea that I wanted to have cscope give that up? Or that supporting generic search would do this? What I'm suggesting is that you support generic search by a separate tag (call it 'text'), and that you maybe limit the search to text files (and stop short at doing stuff like indexing gzip files, etc.) Something like opengrok - http://www.opensolaris.org/os/project/opengrok/%3Bjsessionid=C8E71D0E37FC0E3C4E95AF44F772B2EF - which is great but unfortunately has very little in the way of editor support (vim, emacs, etc), and seems to be very oriented towards the browser. But if necessary, I probably could hack through this to make it do what I want. In any case, look at: http://www.gnu.org/software/idutils/manual/idutils.html#Past-and-Future It says - very explicitly - that they want a cscope like interface, and an 'optional coupling with grep'. I'd say that cscope should have the same goals, and the projects should work together to do this (to avoid duplication of effort). And that I am not alone in my desire to see the three tools work well together. > This begins to feel like you might be suffering from a bout of "new hammer > syndrome" (where as soon as you leave the store, having bought a new hammer, > suddenly everything in the world looks like nails). Search is search is search. I'd counter with your hammer analogy that my wanting fulltext search in cscope for comments or log files is more akin to me going to the hardware store, finding a nice set of allen wrenches, and finding when I get home that they support US measurments but not metric. Ed |