Re: [PATCH 11/12] receive-pack: treat namespace .have lines like alternates
From: Jeff King <hidden>
Date: 2017-01-27 18:25:08
On Fri, Jan 27, 2017 at 06:45:26PM +0100, Lukas Fleischer wrote:
quoted
This is an unrelated tangent, but there may want to be a knob to make the code return here without even showing, to make the advertisement even smaller and also to stop miniscule information leakage? If the namespaced multiple projects are totally unrelated (i.e. "My sysadmin gave me a write access only to this single directory, so I am using the namespace feature to host these three projects that have nothing to do with each other"), showing objects of other namespaces will buy us nothing and the user is better off without this code showing these refs as ".have".I think this is already possible using receive.hideRefs (which causes the ref_is_hidden() branch above to return if applicable). Having support for suppressing .have lines corresponding to different namespaces was actually the reason I implemented 78a766ab6 (hideRefs: add support for matching full refs, 2015-11-03). We have been using namespaces for hosting the package Git repositories of the Arch Linux User Repository [1] with a shared object storage for several months now. See [2] for *some* technical details on how things are implemented; the last section explains how the hideRefs mechanism can be used to limit ref advertisement to the "active" namespace.
Thanks for the pointers. I think a "turn off namespace .have lines" option would be easier for some cases, but what you've implemented is much more flexible. So if people using namespaces are happy with it, I don't see any need to add another way to do the same thing. -Peff