Re: [PATCH v1 10/19] read-cache: regenerate shared index if necessary
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Oct 23, 2016, 16:07 UTC
- Message-ID
- <c30212bd-c454-f1a1-d01c-d6a12d20d17d@ramsayjones.plus.com>
- In-Reply-To
- <20161023092648.12086-11-chriscool@tuxfamily.org>
On 23/10/16 10:26, Christian Couder wrote:
Show 33 quoted lines
> When writing a new split-index and there is a big number of cache > entries in the split-index compared to the shared index, it is a > good idea to regenerate the shared index. > > By default when the ratio reaches 20%, we will push back all > the entries from the split-index into a new shared index file > instead of just creating a new split-index file. > > The threshold can be configured using the > "splitIndex.maxPercentChange" config variable. > > We need to adjust the existing tests in t1700 by setting > "splitIndex.maxPercentChange" to 100 at the beginning of t1700, > as the existing tests are assuming that the shared index is > regenerated only when `git update-index --split-index` is used. > > Signed-off-by: Christian Couder <chriscool@tuxfamily.org> > --- > read-cache.c | 33 ++++++++++++++++++++++++++++++++- > t/t1700-split-index.sh | 1 + > 2 files changed, 33 insertions(+), 1 deletion(-) > > diff --git a/read-cache.c b/read-cache.c > index bb53823..a91fabe 100644 > --- a/read-cache.c > +++ b/read-cache.c > @@ -2216,6 +2216,36 @@ static int write_shared_index(struct index_state *istate, > return ret; > } > > +static const int default_max_percent_split_change = 20; > + > +int too_many_not_shared_entries(struct index_state *istate)
This function is a file-loacal symbol; could you please make it a static function.
Thanks.
ATB, Ramsay Jones