git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-cget: prints elements of C code in the git repository

From
Jeff King <peff@peff.net>
Date
Mar 24, 2009, 13:59 UTC
Message-ID
<20090324135906.GA10644@coredump.intra.peff.net>
In-Reply-To
<49C8E074.4030808@gmail.com>
On Tue, Mar 24, 2009 at 02:30:28PM +0100, Roel Kluin wrote:
Show 7 quoted lines
> > - the commit message is severely lacking (I had to apply it and run it to 
> >   find out what problem it tries to solve),
> 
> This is probably better:
> 
> This script shows where elements of C code are defined in the git-repository.
> It is still experimental, although it should work in most cases.

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. 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).

-Peff
Previous: Ping YinNext: Stefan Karpinski
Message 6 of 16 in “git-cget: prints elements of C code in the git repository”
  1. git-cget: prints elements of C code in the git repositoryRoel Kluin, Mar 24, 2009
  2. Johannes SchindelinMar 24, 2009
  3. Roel KluinMar 24, 2009
  4. Johannes SchindelinMar 24, 2009
  5. Ping YinMar 24, 2009
  6. Jeff KingMar 24, 2009
  7. Stefan KarpinskiMar 24, 2009
  8. Johannes SchindelinMar 24, 2009
  9. Mike RalphsonMar 24, 2009
  10. Johannes SchindelinMar 24, 2009
  11. Mike RalphsonMar 24, 2009
  12. Steven TweedMar 24, 2009
  13. Jeff KingMar 25, 2009
  14. roel kluinMar 24, 2009
  15. roel kluinMar 27, 2009
  16. Johannes SchindelinMar 27, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.