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
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 24, 2009, 12:05 UTC
Message-ID
<alpine.DEB.1.00.0903241257430.7493@intel-tinevez-2-302>
In-Reply-To
<49C8B159.2040600@gmail.com>
Hi,
Disclaimer: if you are offended by constructive criticism, or likely to
answer with insults to the comments I offer, please stop reading this mail
now (and please do not answer my mail, either). :-)
Still with me?  Good.  Nice to meet you.

Just for the record: responding to a patch is my strongest way of saying that I appreciate your work.

On Tue, 24 Mar 2009, Roel Kluin wrote:
Show 5 quoted lines
> Maybe something like this is useful?
> ------------------------------>8-------------8<---------------------------------
> Add git-cget.sh: prints elements of C code in the git repository.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
I really like what this tries to do.
But there are some problems:
- the name is not expressive enough,
- the commit message is severely lacking (I had to apply it and run it to 
  find out what problem it tries to solve),
- it still uses dashed git commands,
- it might be better to put it into contrib/, otherwise it needs 
  documentation with examples, and tests,
- it misdetects functions: trying
	$ ./git-cget -f get_sha1.*
  shows this, amongst others:
-- snip --
// vi sha1_name.c +59
                return get_sha1_hex(hex, sha1) == 0;
        return found;
}
static int match_sha(unsigned len, const unsigned char *a, const unsigned 
char *b)
{
        do {
                if (*a != *b)
                        return 0;
                a++;
                b++;
                len -= 2;
        } while (len > 1);
        if (len)
                if ((*a ^ *b) & 0xf0)
                        return 0;
        return 1;
}
-- snap --
- maybe it would be nicer to integrate this into git grep itself?  Maybe 
  by allowing multi-line matches and default patterns, or pattern 
  templates?

Ciao, Dscho

Previous: Roel KluinNext: Roel Kluin
Message 2 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.