git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH 0/8] Add configuration options for split-index

From
Christian Couder <christian.couder@gmail.com>
Date
Jul 23, 2016, 16:11 UTC
Message-ID
<CAP8UFD20WtCPLb3VzCJnYZSreUM7Q8GOC_VBG3h1j3wjOcR=_w@mail.gmail.com>
In-Reply-To
<CACsJy8ApNJ+EBOVNC0GoPUaO898QRqHUZ2yQ39Qg5uGq4sHHGg@mail.gmail.com>
On Tue, Jul 12, 2016 at 6:01 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 25 quoted lines
> On Mon, Jul 11, 2016 at 7:22 PM, Christian Couder
> <christian.couder@gmail.com> wrote:
>> Future work
>> ~~~~~~~~~~~
>>
>> One thing that is probably missing is a mechanism to avoid having too
>> many changes accumulating in the (split) index while in split index
>> mode. The git-update-index documentation says:
>>
>>         If split-index mode is already enabled and `--split-index` is
>>         given again, all changes in $GIT_DIR/index are pushed back to
>>         the shared index file.
>>
>> but it is probably better to not expect the user to think about it and
>> to have a mechanism that pushes back all changes to the shared index
>> file automatically when some threshold is reached. The threshold could
>> be for example when $GIT_DIR/index size is larger than 25% of the
>> shared index size. Opinions, test results or test ideas are welcome on
>> this.
>
> Oh yes I would like something like this. I stuck to the basics because
> as you see you need to define some criteria to re-split again, but
> without experimenting on real repos, I could just have gone the wrong
> way. Index file size or the percentage of entries in linked/shared
> indexes are two good candidates.

Ok, I started working on automatically pushing back all changes to the shared index when the percentage of entries in linked vs shared indexes is greater than 25% (maybe I will make it configurable later). It is very basic and doesn't work well for now (for one thing it is missing added entries), see:

https://github.com/chriscool/git/commits/config-split-index8

Basically I would like a way to count then entries that are only in the linked index without modifying them to be safe, but I have a hard time seeing how I could modify prepare_to_write_split_index() to get that.

Show 5 quoted lines
> You can also just re-split on
> commands that likely lead to increasing linked index size a lot (maybe
> git-reset), or run long enough that some extra processing won't get
> noticed. For example git-gc should definitely re-split if this feature
> is on, but I can't say if it's often enough.

I'd like to avoid re-split only on some specific commands as I feel it could lead to bad behavior when none of these specific commands are called but the linked index is growing because of other commands.

Previous: Duy NguyenNext: Duy Nguyen
Message 17 of 19 in “Add configuration options for split-index”
  1. 0/8 Add configuration options for split-indexChristian Couder, Jul 11, 2016
  2. 2/8 split-index: add {add,remove}_split_index() functionsChristian Couder, Jul 11, 2016
  3. 3/8 read-cache: add and then use tweak_split_index()Christian Couder, Jul 11, 2016
  4. 5/8 Documentation/config: add information for core.splitIndexChristian Couder, Jul 11, 2016
  5. 6/8 Documentation/git-update-index: talk about core.splitIndex config varChristian Couder, Jul 11, 2016
  6. 7/8 t1700: add tests for core.splitIndexChristian Couder, Jul 11, 2016
  7. 4/8 update-index: warn in case of split-index incoherencyChristian Couder, Jul 11, 2016
  8. 8/8 read-cache: unlink old sharedindex filesChristian Couder, Jul 11, 2016
  9. Duy NguyenJul 11, 2016
  10. Christian CouderJul 12, 2016
  11. Duy NguyenJul 12, 2016
  12. Christian CouderJul 12, 2016
  13. Duy NguyenJul 13, 2016
  14. Christian CouderJul 13, 2016
  15. 1/8 config: add git_config_get_split_index()Christian Couder, Jul 11, 2016
  16. Duy NguyenJul 12, 2016
  17. Christian CouderJul 23, 2016
  18. Duy NguyenJul 25, 2016
  19. Christian CouderJul 25, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.