On Thu, Jan 19, 2017 at 8:30 PM, Michael Haggerty <mhagger@xxxxxxxxxxxx> wrote: > I kindof think that it would have been a better design to store the > references for all linked worktrees in the main repository's ref-store. > For example, the "bisect" refs for a worktree named "<name>" could have > been stored under "refs/worktrees/<name>/bisect/*". Then either: > > * teach the associated tools to read/write references there directly > (probably with DWIM rules to make command-line use easier), or > * treat these references as if they were actually at a standard place > like `refs/worktree/bisect/*`; i.e., users would need to know that they > were per-worktree references, but wouldn't need to worry about the true > locations, or > * treat these references as if they were actually in their traditional > locations (though it is not obvious how this scheme could be expanded to > cover new per-worktree references). Well. In one direction, we store everything at one place and construct different slices of view of the unified store. On the other far end, we have plenty of one-purpose stores, then combine them as we need. It's probably personal taste, but I prefer the latter. Making a single big store could bring us closer to the "big number" problem. Yeah we will have to handle million of refs anyway, someday. That does not mean we're free to increase the number of refs a few more times. Then there are separate stores by nature like submodules (caveat: I haven't checked out your submodule-hash branch), or the problem with multiple repos sharing objects/info/alternates. > This is a topic that I have thought a lot about. I definitely like this > direction. In fact I've dabbled around with some first steps; see branch > `submodule-hash` in my fork on GitHub [1]. That branch associates a > `ref_store` more closely with the directory where the references are > stored, as opposed to having a 1:1 relationship between `ref_store`s and > submodules. Thanks. Will check it out. > Let me braindump some more information about this topic. > ... Juicy stuff :D It's hard to know these without staring really long and hard at refs code. Thank you. > I've taken some stabs at picking these apart into separate ref stores, > but haven't had time to make very satisfying progress. By the time of > GitMerge I might have a better feeling for whether I can devote some > time to this project. I think sending WIP patches to the list from time to time is also helpful, even if it's not perfect. For one thing I would know you were doing (or thinking at least, which also counts) and not stepping on each other. On my part I'm not attempting to make any more changes (*) until after I've read your branches. (*) I took git_path() out of refs code and was surprised that multi worktree broke. Silly me. Wrong first step. -- Duy