threads / discuss / 5723

PATCH/RFC] allow delta data reuse even if base object is a preferred base

Subject: PATCH/RFC] allow delta data reuse even if base object is a preferred base

## tl;dr

2 messages between Sep 27, 2006 and Sep 27, 2006.

replies: 1people: 2as markdown or json

Nicolas Pitre· Sep 27, 2006, 19:42 UTC · lore
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
Any reason why this couldn't be done?

When I reworked that code I preserved the existing logic wrt preferred base. However I could not find a reason why it was that way. Hence this patch.

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 6db97b6..ee5f031 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -989,7 +988,7 @@ static void check_object(struct object_e
 		unuse_packed_git(p);
 		entry->in_pack_header_size = used;
 
-		if (base_entry && !base_entry->preferred_base) {
+		if (base_entry) {
 
 			/* Depth value does not matter - find_deltas()
 			 * will never consider reused delta as the
Junio C Hamano· Sep 27, 2006, 19:53 UTC · re: Nicolas Pitre · lore

Re: PATCH/RFC] allow delta data reuse even if base object is a preferred base

Nicolas Pitre <nico@cam.org> writes:
Show 23 quoted lines
> Signed-off-by: Nicolas Pitre <nico@cam.org>
>
> ---
>
> Any reason why this couldn't be done?
>
> When I reworked that code I preserved the existing logic wrt preferred 
> base.  However I could not find a reason why it was that way.  Hence 
> this patch.
>
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index 6db97b6..ee5f031 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -989,7 +988,7 @@ static void check_object(struct object_e
>  		unuse_packed_git(p);
>  		entry->in_pack_header_size = used;
>  
> -		if (base_entry && !base_entry->preferred_base) {
> +		if (base_entry) {
>  
>  			/* Depth value does not matter - find_deltas()
>  			 * will never consider reused delta as the

I was wondering about it myself the other day because I do not remember the reasoning why I thought we do not want to reuse the delta when the base object is not part of the resulting pack. We would recompute and create the delta ourselves anyway if we do not take this branch, so it is not about avoiding to delta it.

I really do not see the reason now; I think it is safe and reasonable to remove the check.

← back to recent threads