Skip to content

Yet another approach to handling empty snapshots

Michael Haggerty git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6struct snapshot: store `start` rather than `header_len`refs/packed-backend.c+33 -311 reply
2/6create_snapshot(): use `xmemdupz()` rather than a strbufrefs/packed-backend.c+4 -50 replies
3/6find_reference_location(): make function safe for empty snapshotsrefs/packed-backend.c+6 -43 replies
4/6packed_ref_iterator_begin(): make optimization more generalrefs/packed-backend.c+6 -61 reply
5/6load_contents(): don't try to mmap an empty filerefs/packed-backend.c+6 -70 replies
6/6packed_ref_cache: don't use mmap() for small filesrefs/packed-backend.c+3 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] Yet another approach to handling empty snapshots

This patch series fixes the handling of empty packed-refs snapshots (i.e., those with snapshot->buf and friends equal to NULL), partly by changing snapshot to store a pointer to the start of the post-header packed-refs content instead of header_len. It makes a couple of other improvements as well.

I'm not sure whether I like this approach better than the alternative of always setting snapshot->buf to a non-NULL value, by allocating a length-1 bit of RAM if necessary. The latter is less intrusive, though even if that approach is taken, I think patches 01, 02, and 04 from this patch series would be worthwhile improvements.

Michael

Kim Gybels (1):
packed_ref_cache: don't use mmap() for small files

Michael Haggerty (5):
struct snapshot: store start rather than header_len create_snapshot(): use xmemdupz() rather than a strbuf find_reference_location(): make function safe for empty snapshots packed_ref_iterator_begin(): make optimization more general load_contents(): don't try to mmap an empty file

 refs/packed-backend.c | 106 ++++++++++++++++++++++++++------------------------
 1 file changed, 55 insertions(+), 51 deletions(-)
Signature · 1 line
2.14.2