Re: [PATCH v1 10/19] read-cache: regenerate shared index if necessary
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Oct 25, 2016, 10:16 UTC
- Message-ID
- <CACsJy8CfQ6d3Q74W4rm=rJD69EAzuUe7PdrW-5NDo0vHuDSNpw@mail.gmail.com>
- In-Reply-To
- <20161023092648.12086-11-chriscool@tuxfamily.org>
On Sun, Oct 23, 2016 at 4:26 PM, Christian Couder <christian.couder@gmail.com> wrote:
Show 7 quoted lines
> @@ -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.
Show 12 quoted lines
> 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.
Show 6 quoted lines
> git update-index --split-index && > test-dump-split-index .git/index >actual && > indexversion=$(test-index-version <.git/index) && > -- > 2.10.1.462.g7e1e03a >
-- Duy