On 12/8/06, Alex Riesen <raa.lkml@xxxxxxxxx> wrote:
On 12/8/06, Junio C Hamano <junkio@xxxxxxx> wrote: > In 'pu' (jc/diff topic), I have a very generic code to walk the > index, working tree and zero or more trees in parallel, taking > advantage of cache-tree. If somebody is interested to learn the > internals of git, some of the code could be lifted from there > and simplified to walk just the index and a single tree, and I > think that would optimize "diff-index --cached" quite a bit. Will try to look at it.
And now I'm playing with that (against test-para.c from pu). I expect it to be broken by that webGmail, so it may not apply to anything, but you'll get the idea. More clearly than from me trying to explain. commit 83642cdaca6dc1a2f94aa41923bc9e8f02d0e12f Author: Alex Riesen <raa.lkml@xxxxxxxxx> Date: Fri Dec 8 09:38:18 2006 +0100 add --quiet to test-para: stop at the first difference diff --git a/test-para.c b/test-para.c index bce5f0c..99d3792 100644 --- a/test-para.c +++ b/test-para.c @@ -21,6 +21,7 @@ int main(int ac, const char **av) unsigned char trees[64][20]; int num_tree = 0, i, using_head, show_all = 0; int index_wanted = 1, work_wanted = 1, tree_wanted = 0; + int quiet = 0; const char *prefix; const char **pathspec; @@ -43,6 +44,8 @@ int main(int ac, const char **av) work_wanted = 0; else if (!strcmp(av[1] + 2, "no-index")) index_wanted = 0; + else if (!strcmp(av[1] + 2, "quiet")) + quiet = 1; else if (!av[1][2]) break; else @@ -118,7 +121,9 @@ int main(int ac, const char **av) show_one(z, e->name, e->namelen, e->hash, e->mode); } - else + else { + if (quiet) + exit(1); for (i = 0; i < w.num_trees + 2; i++) { char numbuf[10]; @@ -149,6 +154,7 @@ int main(int ac, const char **av) show_one(z, e->name, e->namelen, e->hash, e->mode); } + } } if (!any_different && all_are_trees) - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html