Re: [PATCH] git-fetch: Avoid reading packed refs over and over again
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 18, 2006, 12:33 UTC
- Message-ID
- <Pine.LNX.4.63.0612181329480.3635@wbgn013.biozentrum.uni-wuerzburg.de>
- 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:
Show 10 quoted lines
> --- 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[=<length>]] [--abbrev[=<length>]] [--tags] [--heads] [--] [pattern*]"; > +static const char show_ref_usage[] = "git show-ref [-q|--quiet] [--verify] [-h|--head] [-d|--dereference] [-s|--hash[=<length>]] [--abbrev[=<length>]] [--tags] [--heads] [--] [pattern*] | --filter-invalid < ref-list";
Here, you want to either not mention it at all, or add "--exclude-existing[=<pattern>]" 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