Skip to content

Commit 58840e6

Browse files
committed
Merge branch 'ps/pack-bitmap-optim'
Optimize "rev-list --use-bitmap-index --objects" corner case that uses negative tags as the stopping points. * ps/pack-bitmap-optim: pack-bitmap: avoid traversal of objects referenced by uninteresting tag
2 parents 68e15e0 + 540cdc1 commit 58840e6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

pack-bitmap.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,7 @@ struct bitmap_index *prepare_bitmap_walk(struct rev_info *revs,
997997
object_list_insert(object, &wants);
998998

999999
object = parse_object_or_die(get_tagged_oid(tag), NULL);
1000+
object->flags |= (tag->object.flags & UNINTERESTING);
10001001
}
10011002

10021003
if (object->flags & UNINTERESTING)

t/perf/p5310-pack-bitmaps.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ test_expect_success 'setup bitmap config' '
1515
git config pack.writebitmaps true
1616
'
1717

18+
# we need to create the tag up front such that it is covered by the repack and
19+
# thus by generated bitmaps.
20+
test_expect_success 'create tags' '
21+
git tag --message="tag pointing to HEAD" perf-tag HEAD
22+
'
23+
1824
test_perf 'repack to disk' '
1925
git repack -ad
2026
'
@@ -43,6 +49,14 @@ test_perf 'rev-list (objects)' '
4349
git rev-list --all --use-bitmap-index --objects >/dev/null
4450
'
4551

52+
test_perf 'rev-list with tag negated via --not --all (objects)' '
53+
git rev-list perf-tag --not --all --use-bitmap-index --objects >/dev/null
54+
'
55+
56+
test_perf 'rev-list with negative tag (objects)' '
57+
git rev-list HEAD --not perf-tag --use-bitmap-index --objects >/dev/null
58+
'
59+
4660
test_perf 'rev-list count with blob:none' '
4761
git rev-list --use-bitmap-index --count --objects --all \
4862
--filter=blob:none >/dev/null

0 commit comments

Comments
 (0)