Re: I want to search my project source code

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Matthew Wilson <matt(at)tplus1(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: I want to search my project source code
Date: 2007-10-27 14:25:05
Message-ID: 17159.1193495105@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Wilson <matt(at)tplus1(dot)com> writes:
> At least once a week, I want to find some code that uses a few modules,
> so I have to launch a find + grep at the top of the tree and then wait
> for it to finish.

Personally I use glimpse for this. It's a bit old and creaky but it
performs wonders. There might be something better out there by now.

I wouldn't recommend trying to use a standard FTS to index code:
code is not a natural language and the kinds of searches you usually
want to perform are a lot different. As an example, I glimpse for
"foo" when looking for references to a function foo, but "^foo"
when seeking its definition (this relies on the coding conventions
about function layout, of course). An FTS doesn't think start-of-line
is significant so it can't do that.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2007-10-27 15:13:52 Re: I want to search my project source code
Previous Message Tom Lane 2007-10-27 14:04:20 Re: WAL archiving idle database