On 8/17/2022 6:22 AM, 程洋 wrote: > But I still think the protocol still should tell the server which ref > the blob is reachable. > Because it would be really hard to implement any kind of ACL I think this idea has merit on its face, but it wouldn't really solve the problem since the reachability query would still need to be done, just from a smaller set of references at first. If we were able to say "this blob can be found at path X at commit Y" then the server could do a commit-reachability query and a path traversal, which should be a lot faster. However, it would be extremely difficult to plumb into the partial clone machinery. At the point where Git realizes it is missing a promisor object, that code is very generic and removed from any kind of walk from a reference. That is further complicated by the fact that the walk is probably from a local reference, which can be entirely different from the remote reference. > But git is surely designed for open sources community. It makes senses > this request will be rejected. We try to keep all kinds of users in mind, so the fact that this applies to not-completely-open repositories is not a blocker. One possible hurdle is the fact that this branch-level security is a feature of Gerrit, not a feature of Git itself. Optimizing Git to that special case that Git does not itself support is less valuable to the Git project itself. My personal take is that the technical complexity required to make this faster paired with the limited scope means that this feature would have a difficult time getting accepted into the Git project. Perhaps a motivated contributor will find ways to overcome these obstacles and find other interesting applications that benefit a larger portion of Git users. That's just my expectation. I'd be happy to read any patches that try to solve this problem. Thanks, -Stolee