git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFC] receive-pack: allow for hiding refs outside the namespace

From
Lukas Fleischer <lfleischer@lfos.de>
Date
Oct 28, 2015, 07:00 UTC
Message-ID
<20151028070045.5031.43810@s-8d3a2f8b.on.site.uni-stuttgart.de>
In-Reply-To
<xmqqfv0wcgzx.fsf@gitster.mtv.corp.google.com>
On Tue, 27 Oct 2015 at 19:18:26, Junio C Hamano wrote:
Show 6 quoted lines
> [...]
> When I asked 'Is transfer.hiderefs insufficient?', I wasn't
> expecting it to be usable out of box.  It was a suggestion to build
> on top of it, instead of adding a parallel support for something
> specific to namespaces.
> 

Agreed, and I do have a couple of patches to improve hideRefs. I still have some questions before submitting them, though. See below.

Show 9 quoted lines
> For example, if the problem is that you cannot tell ref_is_hidden()
> what namespace the ref is from because it is called after running
> strip_namespace(), perhaps you can find a way to have the original
> "namespaced ref" specified on transfer.hiderefs and match them?
> Then in repository for project A, namespaced refs for project B can
> be excluded by specifying refs/namespaces/B/* on transfer.hiderefs.
> 
> Perhaps along the lines of this?
> [...]

My original question remains: Do we want to continue supporting things like transfer.hideRefs=.have (which currently magically hides all refs outside the current namespace)? For 100% backwards compatibility, we would have to. On the other hand, one could consider the current behavior a bug and one could argue that it is weird enough that probably nobody (apart from me) relies on it right now. If we decide to keep it anyway, I think it should be documented.

Another patch I have in my patch queue adds support for a whitelist mode to hideRefs. There are several ways to implement that:

1. Make transfer.hideRefs='' hide all refs (it currently does not). The
   user can then whitelist refs explicitly using negative patterns
   below that rule. This is how my current implementation works. Using
   the empty string seemed most natural since hideRefs matches prefixes
   and every string has the empty string as a prefix. If that seems too
   weird, we could probably special case something like
   transfer.hideRefs='*' instead.
2. Detect whether hideRefs only contains negative patterns. Switch to
   whitelist mode ("hide by default") in that case.
3. Add another option to switch between "hide by default" and "show by
   default".
I personally prefer the first option. Any other opinions?
Previous: Junio C HamanoNext: Jeff King
Message 12 of 17 in “receive-pack: allow for hiding refs outside the namespace”
  1. receive-pack: allow for hiding refs outside the namespaceLukas Fleischer, Oct 26, 2015
  2. Junio C HamanoOct 26, 2015
  3. Allow hideRefs to match refs outside the namespaceLukas Fleischer, Oct 28, 2015
  4. Junio C HamanoOct 28, 2015
  5. Lukas FleischerOct 31, 2015
  6. Junio C HamanoOct 31, 2015
  7. Lukas FleischerOct 31, 2015
  8. Lukas FleischerNov 1, 2015
  9. Junio C HamanoNov 1, 2015
  10. Lukas FleischerOct 27, 2015
  11. Junio C HamanoOct 27, 2015
  12. Lukas FleischerOct 28, 2015
  13. Jeff KingOct 28, 2015
  14. Junio C HamanoOct 28, 2015
  15. Junio C HamanoOct 30, 2015
  16. Jeff KingOct 30, 2015
  17. Lukas FleischerOct 31, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.