Re: [PATCH/RFC] receive-pack: allow for hiding refs outside the namespace
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 28, 2015, 15:48 UTC
- Message-ID
- <xmqq611rm1u0.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20151028070045.5031.43810@s-8d3a2f8b.on.site.uni-stuttgart.de>
Lukas Fleischer <lfleischer@lfos.de> writes:
> 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
Hmph, that even sounds like a bug. parse_hide_refs_config() does not seem to reject ref[] whose length is zero, and ref_is_hidden() would just check "starts_with(refname, match)" with an empty string as "match", so I would naively have expected that to work already.
Ahh, there is "if refname[len] is at the end or slash boundary" check after that. You're right--you'd need to tweak that one for it to work.
> user can then whitelist refs explicitly using negative patterns > below that rule. This is how my current implementation works.
That sounds like a good way to go.
Thanks.