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

Re: [PATCH] Don't allow fast-import tree delta chains to exceed maximum depth

From
Brian Downing <bdowning@lavos.net>
Date
Nov 14, 2007, 05:45 UTC
Message-ID
<20071114054524.GV6212@lavos.net>
In-Reply-To
<20071114044842.GA6876@spearce.org>
On Tue, Nov 13, 2007 at 11:48:42PM -0500, Shawn O. Pearce wrote:
Show 9 quoted lines
> @@ -1105,7 +1108,7 @@ static int store_object(
>  		unsigned pos = sizeof(hdr) - 1;
>  
>  		delta_count_by_type[type]++;
> -		last->depth++;
> +		e->depth = ++last->depth++;
>  
>  		hdrlen = encode_header(OBJ_OFS_DELTA, deltalen, hdr);
>  		write_or_die(pack_data->pack_fd, hdr, hdrlen);
I'm not sure, but I think that's too many ++'s.
The earlier patch had:
@@ -1084,6 +1087,7 @@ static int store_object(

                delta_count_by_type[type]++;
                last->depth++;
+               e->depth = last->depth;

                hdrlen = encode_header(OBJ_OFS_DELTA, deltalen, hdr);
                write_or_die(pack_data->pack_fd, hdr, hdrlen);

Which of course would be the equivalent of:

> +		e->depth = ++last->depth;

Maybe there's some cleverness here I'm missing, though.

-bcd
Previous: Shawn O. PearceNext: Junio C Hamano
Message 2 of 4 in “Don't allow fast-import tree delta chains to exceed maximum depth”
  1. Don't allow fast-import tree delta chains to exceed maximum depthShawn O. Pearce, Nov 14, 2007
  2. Brian DowningNov 14, 2007
  3. Junio C HamanoNov 14, 2007
  4. Shawn O. PearceNov 14, 2007

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.