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

Re: [PATCH 08/13] prevent try_delta from using objects not in pack

From
Junio C Hamano <junkio@cox.net>
Date
Apr 5, 2007, 23:04 UTC
Message-ID
<7v8xd6mni1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<56b7f5510704051535ya98e86eu7f786f118c4fe229@mail.gmail.com>
"Dana How" <danahow@gmail.com> writes:
Show 21 quoted lines
> Subject: [PATCH 08/13] prevent try_delta from using objects not in pack
>
> ---
>  builtin-pack-objects.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index 9eb5fd6..37b0150 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -1251,6 +1251,10 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
>  	if (trg_entry->type != src_entry->type)
>  		return -1;
>  
> +	/* Don't try deltas involving already/non written objects */
> +	if (trg_entry->no_write || src_entry->no_write)
> +		return -1;
> +
>  	/* We do not compute delta to *create* objects we are not
>  	 * going to pack.
>  	 */

I think trg_entry->no_write case should return -1 (meaning: doesn't delta with this source, nor any other sources you would throw at try_delta()), but shouldn't src_entry->no_write case return 0 (meaning: does not delta with this source, but do not give up -- other source candidate you have might be usable)?

Previous: Dana HowNext: Nicolas Pitre
Message 2 of 8 in “prevent try_delta from using objects not in pack”
  1. 08/13 prevent try_delta from using objects not in packDana How, Apr 5, 2007
  2. Junio C HamanoApr 5, 2007
  3. Nicolas PitreApr 6, 2007
  4. Dana HowApr 6, 2007
  5. Nicolas PitreApr 6, 2007
  6. Dana HowApr 6, 2007
  7. Nicolas PitreApr 6, 2007
  8. Dana HowApr 6, 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.