Query regarding Shared Indexing Behavior in IntelliJ IDEA
Hello!
I am currently working on a large project where we are considering implementing Shared Indexing. I have a specific scenario that I would like to inquire about, specifically regarding how IntelliJ IDEA handles the indexing process in certain situations.
Scenario:
Suppose I have uploaded shared indexes for a commit (let's say commit A) in my project. Subsequently, I make additional commits (commit B and commit C) on top of commit A, but shared indexes for these commits are not yet available.
Question:
When someone clones the entire repository or pulls new commits in their local environment using IntelliJ IDEA, how does IntelliJ IDEA handle the indexing process? Will it simply recognise that the latest commit is commit C, for which shared indexes are not available, and proceed to build indexes locally from scratch? Alternatively, does IntelliJ IDEA go down the commit history to commit A, fetch the shared indexes for those commits, and then build indexes for commits B and C locally on top of that? If the latter is the case, I would like to know how far down the commit history IntelliJ IDEA goes to retrieve shared indexes.
Any help would be greatly appreciated. Thanks!
请先登录再写评论。
There is no need to index every commit when using shared indexes. IDE checks indexes for the last 2048 commits in a project (only git is supported) and if there are ones, it downloads them, if not, it takes the last shared indexes and uses them.
Then it will index file changes locally after that commit.
Hello Lejia,
Thanks for your response.
Could you please provide further explanation as to why there is no need to index every commit when using shared indexes? Suppose I want to set up a machine that periodically fetches the latest changes/commits, generates indexes for them, and syncs these new indexes with remote storage. In this case, would it be sufficient to generate indexes only for the latest commit, such as commit C? If so, what happens to commit B? Are its indexes always built locally on top of the shared indexes for commit A?
And lastly, is it possible to change the previous number of commits checked by the IDE when using shared indexes or is it fixed to 2048?
There is no need to index every commit because the indexes could be effectively used even if it doesn't cover all files.
Yes, it will be. If you're actively committing changes to the project, you can generate indexes once in 1-3 days; if not, once a week or even less often is enough.
If the user has a commit B, and the indexes exist for commits A and C, shared indexes for commit A will be used, and missing files will be indexed locally.
For now, there is no opportunity to configure this amount. Could you please specify if you want more or fewer commits to be indexed?