From: Taylor Blau <me@ttaylorr.com>
To: Jeff King <peff@peff.net>
Cc: Taylor Blau <me@ttaylorr.com>,
git@vger.kernel.org, chriscool@tuxfamily.org
Subject: Re: [PATCH 2/4] upload-pack.c: allow banning certain object filter(s)
Date: Mon, 20 Jul 2020 16:05:28 -0400 [thread overview]
Message-ID: <20200720200528.GA91942@syl.lan> (raw)
In-Reply-To: <20200708084527.GB2324177@coredump.intra.peff.net>
On Wed, Jul 08, 2020 at 04:45:27AM -0400, Jeff King wrote:
> On Thu, Jul 02, 2020 at 04:06:32PM -0400, Taylor Blau wrote:
>
> > +static void parse_object_filter_config(const char *var, const char *value,
> > + struct upload_pack_data *data)
> > +{
> > + struct strbuf spec = STRBUF_INIT;
> > + const char *sub, *key;
> > + size_t sub_len;
> > +
> > + if (parse_config_key(var, "uploadpack", &sub, &sub_len, &key))
> > + return;
> > + if (!sub || !skip_prefix(sub, "filter.", &sub))
> > + return;
>
> Just while I'm thinking about the config name and case-sensitivity (from
> the cover letter): if we did want to use this scheme, then
> skip_iprefix() would make this behave more like a regular part of the
> section name.
>
> But I'd prefer to just do away with it by using a scheme that doesn't
> have the extra layer of dots.
Yeah. I definitely flip-flopped on this when preparing this for the
list. I still feel like 'uploadpackfilter' is gross, so I was hoping to
send it with 'uploadpack.filter' (which reads nicely, but forces us to
write some gross code), but both options are frustrating to me for
different reasons.
Playing around with it more, though, I think that uploadpackfilter is
our best bet. I'd hate to introduce a string manipulation bug by munging
the reuslt of 'parse_config_key()', which is so clearly designed for
something like 'uploadpackfilter[.<filter>].allow'.
> > + if (sub != key)
> > + strbuf_add(&spec, sub, key - sub - 1);
> > + strbuf_tolower(&spec);
>
> On the flip side, I'd actually consider _not_ matching the filter name
> case-insensitively. We don't do so elsewhere (e.g., "git rev-list
> --filter=BLOB:NONE" will complain).
I dropped the case-insensitive matching in the latest revision. I don't
think that we need to be overly accommodating here.
> -Peff
Thanks,
Taylor
next prev parent reply other threads:[~2020-07-20 20:05 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-02 20:06 [PATCH 0/4] upload-pack: custom allowed object filters Taylor Blau
2020-07-02 20:06 ` [PATCH 1/4] list_objects_filter_options: introduce 'list_object_filter_config_name' Taylor Blau
2020-07-02 20:06 ` [PATCH 2/4] upload-pack.c: allow banning certain object filter(s) Taylor Blau
2020-07-08 8:45 ` Jeff King
2020-07-20 20:05 ` Taylor Blau [this message]
2020-07-15 10:00 ` SZEDER Gábor
2020-07-15 10:55 ` Jeff King
2020-07-20 20:07 ` Taylor Blau
2020-07-20 20:21 ` Jeff King
2020-07-22 9:17 ` SZEDER Gábor
2020-07-22 20:15 ` Taylor Blau
2020-07-23 1:41 ` Junio C Hamano
2020-07-23 1:50 ` Taylor Blau
2020-07-22 9:21 ` SZEDER Gábor
2020-07-22 20:16 ` Taylor Blau
2020-07-23 7:51 ` SZEDER Gábor
2020-07-23 14:13 ` Taylor Blau
2020-07-02 20:06 ` [PATCH 3/4] upload-pack.c: pass 'struct list_objects_filter_options *' Taylor Blau
2020-07-02 20:06 ` [PATCH 4/4] upload-pack.c: introduce 'uploadpack.filter.tree.maxDepth' Taylor Blau
2020-07-15 10:11 ` SZEDER Gábor
2020-07-08 8:41 ` [PATCH 0/4] upload-pack: custom allowed object filters Jeff King
2020-07-20 20:09 ` Taylor Blau
2020-07-21 20:06 ` Junio C Hamano
2020-07-21 20:27 ` Taylor Blau
2020-07-21 22:05 ` 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=20200720200528.GA91942@syl.lan \
--to=me@ttaylorr.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/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).