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

Re: [PATCH 2/2] fast-import: treat cat-blob as a delta base hint for next blob

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 20, 2011, 19:17 UTC
Message-ID
<20110820191754.GA22833@elie.gateway.2wire.net>
In-Reply-To
<1313867052-11993-3-git-send-email-divanorama@gmail.com>
Dmitry Ivankov wrote:
Show 14 quoted lines
> --- a/fast-import.c
> +++ b/fast-import.c
> @@ -2802,7 +2802,12 @@ static void cat_blob(struct object_entry *oe, unsigned char sha1[20])
>  	strbuf_release(&line);
>  	cat_blob_write(buf, size);
>  	cat_blob_write("\n", 1);
> -	free(buf);
> +	if (oe && oe->pack_id == pack_id) {
> +		strbuf_attach(&last_blob.data, buf, size, size);
> +		last_blob.offset = oe->idx.offset;
> +		last_blob.depth = oe->depth;
> +	} else
> +		free(buf);
>  }
Neat.  For what it's worth,
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Previous: Dmitry IvankovNext: David Michael Barr
Message 4 of 5 in “fast-import: improve deltas for blobs”
  1. 0/2 fast-import: improve deltas for blobsDmitry Ivankov, Aug 20, 2011
  2. 1/2 fast-import: count and report # of calls to diff_delta in statsDmitry Ivankov, Aug 20, 2011
  3. 2/2 fast-import: treat cat-blob as a delta base hint for next blobDmitry Ivankov, Aug 20, 2011
  4. Jonathan NiederAug 20, 2011
  5. David Michael BarrAug 21, 2011

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.