eric
Tue, 30 Jan 2001 10:12:38 -0800
Did the jtags 1 pass versus 3 pass issue ever get resolved? If not, and if cygwin xargs is not able to handle a large number of arguments (surprising, since that's pretty much the point of xargs), then it seems like the easiest fix would be to ditch xargs in favor of a good old temp file. That is, instead of find | xargs cmd find | xargs cmd find | xargs cmd do find > tempfile cmd < tempfile rm tempfile Eric In message <[EMAIL PROTECTED]>, Paul Kinnucan write s: : At 12:24 PM 1/4/01 -0500, Charles Rich wrote: : >Paul, : > : > The revision you made to jtags below, in which the tagging process : >is broken into three passes, has an undesirable side-effect when the : >resulting TAGS file is used for tags-search or tags-query-replace. : > : > The problem is that each file in the source directory appears _three_ : >times in the TAGS file, which means that each file will be visited three tim >es : >by tags-search, etc. (I tested this). This is very inconvenient if you want : >for example, to review all uses of a particular identifier or replace : >only some occurrences of a pattern. : > : > I am not very familiar with xargs, but I wonder if there is some other wa >y : >around the buffer problem you cite below. : > : : It has been a long time since I made this change, but I think it was a : response to a problem that arose when I first tried to tag the JDK source : files several years ago. The JDK source hierarchy is huge and attempting to : tag it recursively in a single pass, using find and xargs, failed, at least : on Windows, because of some limitation on Cygwin xargs buffer capacity. I : was then and still am not very versed in either xargs or tags usage. : However, I've noticed that here at the Mathworks we use a hierarchical : tagging scheme for tagging large source hierarchies, i.e., a hierarchy of : tag files that mirrors the source hierarchy rather than one huge tags file : that contains tags for the entire hierarchy. So it seems to me that if one : used this approach it should be possible to tag each directory in a single : pass instead of multiple passes. : : So some possible solutions to the problem are: : : 1) If it is possible to set xargs buffer capacity, up the capacity and : restore jtags to a single pass approach. : : 2) Disregarding the issue of xarg capacity, write a single-pass version of : jtags for use by people who have small hierarchies or who use a tag file : hierarchy to tag large source hierearchies where each tag file is small. : : 3) Create a Java program (or beanshell program) that does the same thing as : jtags, i.e.. recurse through a source hierarchy to build a single tags : file. This would avoid the find/xarg memory capacity issue. : : - Paul : : : : : > Regards, and thanks for a _great_ JDE! : > : >-CR : > : ># Revision 1.5 1997/12/03 03:31:29 kinnucan : ># Divided tagging process into three passes : ># through the source hierarchy to avoid overflowing : ># the xargs buffer. : > : >-- : > Charles Rich | Mitsubishi Electric Research Laboratories : > 617-621-7507 phone | 201 Broadway : > 617-621-7550 fax | Cambridge, MA 02139 : > [EMAIL PROTECTED] | http://www.merl.com :