On Thu, Feb 09, 2017 at 02:26:57PM +0100, Michael Haggerty wrote: > I have mentioned this patch series on the mailing list a couple of > time [1,2] but haven't submitted it before. I just rebased it to > current master. It is available from my Git fork [3] as branch > "submodule-hash". > > The first point of this patch series is to optimize submodule > `ref_store` lookup by storing the `ref_store`s in a hashmap rather > than a linked list. But a more interesting second point is to weaken > the 1:1 relationship between submodules and `ref_stores` a little bit > more. Sounds good. I remember this had been discussed before due to performance issues with resolve_gitlink_ref(), and we took a different route (not populating non-submodule entries). I think it's nice to have both optimizations, though, as they hit different use cases. > A `files_ref_store` would be perfectly happy to represent, say, the > references *physically* stored in a linked worktree (e.g., `HEAD`, > `refs/bisect/*`, etc) even though that is not the complete collection > of refs that are *logically* visible from that worktree (which > includes references from the main repository, too). But the old code > was confusing the two things by storing "submodule" in every > `ref_store` instance. > > So push the submodule attribute down to the `files_ref_store` class > (but continue to let the `ref_store`s be looked up by submodule). I'm not sure I understand all of the ramifications here. It _sounds_ like pushing this down into the files-backend code would make it harder to have mixed ref-backends for different submodules. Or is this just pushing down an implementation detail of the files backend, and future code is free to have as many different ref_stores as it likes? -Peff