[PATCH 10/11] pack-bitmap.c: record whether the result was filtered

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In a following commit, we will prepare to mark objects for reuse which
are stored as deltas, but whose base object wasn't included in the
output pack (e.g., because the client already has it).

We can't, however, take advantage of that optimization when the
traversal removed objects from the result due to either (a) object
filtering, or (b) --unpacked.

That's because in either case, we can't rely on the principle that "if
an object appears in the 'haves' bitmap, that the client already has
that object", since they may not have it as a result of filtering.

Keep track of whether or not we performed any object filtering during
our traversal in preparation to actually implement thin delta
conversion.

Signed-off-by: Taylor Blau <me@xxxxxxxxxxxx>
---
 pack-bitmap.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/pack-bitmap.c b/pack-bitmap.c
index 8326a20979e..67ea267ed2a 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -112,6 +112,12 @@ struct bitmap_index {
 	/* "have" bitmap from the last performed walk */
 	struct bitmap *haves;
 
+	/*
+	 * Whether the last performed walk had objects removed from
+	 * 'result' due to object filtering.
+	 */
+	int filtered;
+
 	/* Version of the bitmap index */
 	unsigned int version;
 };
@@ -1684,6 +1690,8 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
 			bitmap_unset(to_filter, pos);
 	}
 
+	bitmap_git->filtered = 1;
+
 	bitmap_free(tips);
 }
 
@@ -1776,6 +1784,8 @@ static void filter_bitmap_blob_limit(struct bitmap_index *bitmap_git,
 			bitmap_unset(to_filter, pos);
 	}
 
+	bitmap_git->filtered = 1;
+
 	bitmap_free(tips);
 }
 
@@ -1892,6 +1902,8 @@ static void filter_packed_objects_from_bitmap(struct bitmap_index *bitmap_git,
 		if (has_object_pack(&eindex->objects[i]->oid))
 			bitmap_unset(result, objects_nr + i);
 	}
+
+	bitmap_git->filtered = 1;
 }
 
 struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
-- 
2.47.0.11.g487258bca34





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux