From: Mike Ralphson Date: Tue, 24 Mar 2009 14:38:06 GMT Subject: Re: [PATCH] git-cget: prints elements of C code in the git repository Message-ID: In-Reply-To: <20090324135906.GA10644@coredump.intra.peff.net> 2009/3/24 Jeff King : > Wouldn't it be a lot easier to base this on something like ctags, which > already knows how to do all the parsing of C quirky C? > > I.e.: > >  git ls-files | xargs ctags >  vi -t get_sha1 > > Where you can replace "vi" with your editor of choice. This kind of pipeline has the benefit that it can actually work on the *repository*, and not just the working copy (as per the posted script). Although this kind of tool might be useful (I might even use it myself for working on git, rather than as *part of git* on my other projects, which are not written in C), it's a bit tangential even for contrib/ isn't it? > And if you really like getting the definition dumped to stdout, > writing a command-line viewer for the ctags format would be > quite simple (and I would be surprised if one hasn't been > written already). http://users.telenet.be/bdr/pub/cshow/ ? Mike