From: Johannes Schindelin Date: Mon, 18 Dec 2006 12:33:28 GMT Subject: Re: [PATCH] git-fetch: Avoid reading packed refs over and over again Message-ID: In-Reply-To: <7vslfe3r4d.fsf@assigned-by-dhcp.cox.net> Hi, On Sun, 17 Dec 2006, Junio C Hamano wrote: > How about this as a replacement? Makes sense, except for: > --- a/builtin-show-ref.c > +++ b/builtin-show-ref.c > @@ -2,8 +2,9 @@ > #include "refs.h" > #include "object.h" > #include "tag.h" > +#include "path-list.h" > > -static const char show_ref_usage[] = "git show-ref [-q|--quiet] [--verify] [-h|--head] [-d|--dereference] [-s|--hash[=]] [--abbrev[=]] [--tags] [--heads] [--] [pattern*]"; > +static const char show_ref_usage[] = "git show-ref [-q|--quiet] [--verify] [-h|--head] [-d|--dereference] [-s|--hash[=]] [--abbrev[=]] [--tags] [--heads] [--] [pattern*] | --filter-invalid < ref-list"; Here, you want to either not mention it at all, or add "--exclude-existing[=]" instead of "--filter-invalid". > + if (!strcmp(buf + len - 3, "^{}")) { Here you have to check first, if len > 3. Strictly speaking, there should not be any line coming in which is shorter than 42 bytes. But I was recentely bitten by such an assuption... Overall, I like it. I even have the impression that this could actually open a way to build in fetch instead of relying on a POSIX conformant and fast shell for such a central part of git. Ciao, Dscho