From: Ken S. <kg...@gm...> - 2011-02-20 16:44:05
|
2011/2/20 Hans-Bernhard Bröker <HBB...@t-...>: > On 17.02.2011 19:31, Ken Smith wrote: > >>>> I'm happy to learn that cscope already does what I want but so far, I >>>> don't think -P does. I'm happy to be proven wrong. >>> >>> You don't want to pass $(pwd) to -P. It's meant to be used like this: >>> >>> cscope -d -f /some/where/cscope.out -P/some/where >> >> This does work but I find it more straightforward to build the >> database with absolute paths. Is there any harm in that? > > There's always the off chance that people might be storing huge source tree, > including their cscope databases, on network drives, which are mounted > differently by different users. -P survives that, absolute paths wouldn't. Fair enough. But I think the usual case is that every developer has a working copy of everything they need checked out from version control and generates a cscope database for it. Also, back in the day, I remember folks mounting network drives differently on different computers but lately I don't encounter that. Perhaps folks are coming to the conclusion that a consistent environment is more valuable than giving the flexibility and responsiblity of filesystem organization to the end user. I agree that the interface of cscope is not incorrect. I assert that it optimizes for the rare case and is redundant in the common case. > Or one could build the database for one source tree, then use it to browse a > modified copy of it. That currently doesn't need a -P option at all. > >> But isn't it more convenient to simply build the database with >> absolute paths and then you don't have to use -P to load each one of >> them every time. Indeed, the invocation is somewhat redundant don't >> you think? > > Only if the paths for -f and -P were _always_ the same. Which, as shown > above, needn't be true. I'm only talking about default behavior which I admit may be too late since users probably already rely on the present default behavior. I am suggesting that -f path should assume -P `basename path`. Let -P override this default behavior. In this case too, I think cscope's interface optimizes for the uncommon case. |