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

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

Previous: Junio C HamanoNext: Han-Wen Nienhuys
Message 3 of 6 in “git-fetch: Avoid reading packed refs over and over again”
  1. git-fetch: Avoid reading packed refs over and over againJohannes Schindelin, Dec 17, 2006
  2. Junio C HamanoDec 18, 2006
  3. Johannes SchindelinDec 18, 2006
  4. Han-Wen NienhuysDec 30, 2006
  5. Johannes SchindelinDec 30, 2006
  6. Han-Wen NienhuysDec 30, 2006

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.