Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-06-13 16:19:40 +0400
committerJunio C Hamano <gitster@pobox.com>2014-06-13 22:49:40 +0400
commit96a1d8d34c16be8fc5acd7ceb4d34573d8e2a76b (patch)
tree91116aa899d1c5d131a36cc852d21b6a28ac7971 /split-index.h
parent078a58e825d14987df82af9d19c00ddc8eb82481 (diff)
split-index: the writing part
prepare_to_write_split_index() does the major work, classifying deleted, updated and added entries. write_link_extension() then just writes it down. An observation is, deleting an entry, then adding it back is recorded as "entry X is deleted, entry X is added", not "entry X is replaced". This is simpler, with small overhead: a replaced entry is stored without its path, a new entry is store with its path. A note about unpack_trees() and the deduplication code inside prepare_to_write_split_index(). Usually tracking updated/removed entries via read-cache API is enough. unpack_trees() manipulates the index in a different way: it throws the entire source index out, builds up a new one, copying/duplicating entries (using dup_entry) from the source index over if necessary, then returns the new index. A naive solution would be marking the entire source index "deleted" and add their duplicates as new. That could bring $GIT_DIR/index back to the original size. So we try harder and memcmp() between the original and the duplicate to see if it needs updating. We could avoid memcmp() too, by avoiding duplicating the original entry in dup_entry(). The performance gain this way is within noise level and it complicates unpack-trees.c. So memcmp() is the preferred way to deal with deduplication. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'split-index.h')
-rw-r--r--split-index.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/split-index.h b/split-index.h
index 812e510f7e..53b778fa61 100644
--- a/split-index.h
+++ b/split-index.h
@@ -3,10 +3,14 @@
struct index_state;
struct strbuf;
+struct ewah_bitmap;
struct split_index {
unsigned char base_sha1[20];
struct index_state *base;
+ struct ewah_bitmap *delete_bitmap;
+ struct ewah_bitmap *replace_bitmap;
+ struct cache_entry **saved_cache;
unsigned int saved_cache_nr;
int refcount;
};