Thread (39 messages) flat view 39 messages, 3 authors, 2016-11-09

Re: [PATCH v1 10/19] read-cache: regenerate shared index if necessary

From: Duy Nguyen <hidden>
Date: 2016-10-25 10:16:42

On Sun, Oct 23, 2016 at 4:26 PM, Christian Couder
[off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -2233,7 +2263,8 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
                if ((v & 15) < 6)
                        istate->cache_changed |= SPLIT_INDEX_ORDERED;
        }
-       if (istate->cache_changed & SPLIT_INDEX_ORDERED) {
+       if (istate->cache_changed & SPLIT_INDEX_ORDERED ||
+           too_many_not_shared_entries(istate)) {
It's probably safer to keep this piece unchanged and add this
somewhere before it

if (too_many_not_shared_entries(istate))
    istate->cache_changed |= SPLIT_INDEX_ORDERED;

We could keep cache_changed consistent until the end this way.
quoted hunk ↗ jump to hunk
                int ret = write_shared_index(istate, lock, flags);
                if (ret)
                        return ret;
diff --git a/t/t1700-split-index.sh b/t/t1700-split-index.sh
index db8c39f..507a1dd 100755
--- a/t/t1700-split-index.sh
+++ b/t/t1700-split-index.sh
@@ -8,6 +8,7 @@ test_description='split index mode tests'
 sane_unset GIT_TEST_SPLIT_INDEX

 test_expect_success 'enable split index' '
+       git config splitIndex.maxPercentChange 100 &&
An alternative name might be splitThreshold. I don't know, maybe
maxPercentChange is better.
        git update-index --split-index &&
        test-dump-split-index .git/index >actual &&
        indexversion=$(test-index-version <.git/index) &&
--
2.10.1.462.g7e1e03a


-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help