From: Jeff King <peff@peff.net>
To: Lukas Fleischer <lfleischer@lfos.de>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH/RFC] receive-pack: allow for hiding refs outside the namespace
Date: Wed, 28 Oct 2015 09:42:13 -0400 [thread overview]
Message-ID: <20151028134212.GA9657@sigill.intra.peff.net> (raw)
In-Reply-To: <20151028070045.5031.43810@s-8d3a2f8b.on.site.uni-stuttgart.de>
On Wed, Oct 28, 2015 at 08:00:45AM +0100, Lukas Fleischer wrote:
> 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.
I don't think that hiding ".have" refs at that level is especially
useful. I do not use namespaces, but I do use alternates extensively,
and that is the original source of these ".have" refs. But filtering
them at the advertisement layer is very inefficient, as it is expensive
to get the list in the first place (we spawn ls-remote, which spawns
upload-pack in the alternate!). So we'd want to prevent that process
much earlier.
I have an unpublished patch to specially disable alternates
advertisement entirely (i.e., adding a new boolean config,
receive.advertiseAlternates). In my case, it is because the alternates
repositories have huge numbers of refs (sometimes ranging into the
gigabytes) and the performance hit on even loading that packed-refs file
is too large.
I suppose that behavior _could_ be triggered by ".have" appearing in the
hiderefs config, though (i.e., before accessing the alternate, check
ref_is_hidden(".have")). That seems a bit too subtle to me, though.
> 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?
I am just a bystander and would not use this myself, but I think the 1st
is the least ugly. I am not sure why ignoring "refs/" does not work,
though (it does not catch ".have", of course, but I think that is a
feature; there are a finite set of pseudo-refs, so you can ignore those,
too, if you want).
-Peff
next prev parent reply other threads:[~2015-10-28 13:42 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-26 8:09 [PATCH/RFC] receive-pack: allow for hiding refs outside the namespace Lukas Fleischer
2015-10-26 19:58 ` Junio C Hamano
[not found] ` <20151027053916.3030.8259@typhoon.lan>
[not found] ` <20151027055911.4877.94179@typhoon.lan>
2015-10-27 14:32 ` Lukas Fleischer
2015-10-27 18:18 ` Junio C Hamano
2015-10-28 7:00 ` Lukas Fleischer
2015-10-28 13:42 ` Jeff King [this message]
2015-10-28 15:48 ` Junio C Hamano
2015-10-30 21:31 ` Junio C Hamano
2015-10-30 21:46 ` Jeff King
2015-10-31 9:03 ` Lukas Fleischer
2015-10-28 15:42 ` [PATCH] Allow hideRefs to match " Lukas Fleischer
2015-10-28 16:21 ` Junio C Hamano
2015-10-31 8:49 ` Lukas Fleischer
2015-10-31 17:31 ` Junio C Hamano
2015-10-31 23:40 ` Lukas Fleischer
2015-11-01 11:27 ` Lukas Fleischer
2015-11-01 18:18 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151028134212.GA9657@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=lfleischer@lfos.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).