From: Christian Couder <christian.couder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>, Jeff King <peff@peff.net>,
Christian Couder <chriscool@tuxfamily.org>
Subject: Re: [RFC PATCH 3/5] pack-objects: add delta-islands support
Date: Sun, 5 Aug 2018 19:40:19 +0200 [thread overview]
Message-ID: <CAP8UFD2Ri6N33UhZSHOvxtxiCBC13-1rpa_ZByY9dsyPjmaC8A@mail.gmail.com> (raw)
In-Reply-To: <xmqqfu08zhh7.fsf@gitster-ct.c.googlers.com>
On Tue, Jul 24, 2018 at 7:11 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
> Another thing I noticed from 2/5 is that you can have up to 7 such
> capture groups. I do not have any opinion if 7 is too few or too
> many, but we would want the number to be documented, and end-user
> input diagnosed when it requires more captures than we support (if
> we are not already checking, that is).
This is the new documentation:
-> Refs are grouped into islands based on their "names", and two regexes
-> that produce the same name are considered to be in the same
-> island. The names are computed from the regexes by concatenating any
-> capture groups from the regex, with a '-' dash in between. (And if
-> there are no capture groups, then the name is the empty string, as in
-> the above example.) This allows you to create arbitrary numbers of
-> islands. Only up to 7 such capture groups are supported though.
I added the last sentence above, but I wonder if it is 7 or 8. The
code is the following:
-> static int find_island_for_ref(const char *refname, const struct
object_id *oid,
-> int flags, void *data)
-> {
-> int i, m;
-> regmatch_t matches[8];
-> struct strbuf island_name = STRBUF_INIT;
->
-> /* walk backwards to get last-one-wins ordering */
-> for (i = island_regexes_nr - 1; i >= 0; i--) {
-> if (!regexec(&island_regexes[i], refname,
-> ARRAY_SIZE(matches), matches, 0))
-> break;
-> }
I also wonder if the above is enough to diagnose end-user input when
it requires more captures than we support. A quick look at the man
page of the regex functions wasn't enough to enlighten me. Any input
on these issues is very welcome!
next prev parent reply other threads:[~2018-08-05 17:40 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-22 5:48 [RFC PATCH 0/5] Add delta islands support Christian Couder
2018-07-22 5:48 ` [RFC PATCH 1/5] packfile: make get_delta_base() non static Christian Couder
2018-07-24 16:19 ` Junio C Hamano
2018-07-27 11:29 ` Jeff King
2018-07-22 5:48 ` [RFC PATCH 2/5] Add delta-islands.{c,h} Christian Couder
2018-07-22 8:50 ` Duy Nguyen
2018-07-22 13:57 ` Christian Couder
2018-08-05 18:53 ` Christian Couder
2018-08-06 14:17 ` Jeff King
2018-08-06 15:53 ` Duy Nguyen
2018-08-06 18:54 ` Christian Couder
2018-08-06 19:21 ` Duy Nguyen
2018-07-24 16:47 ` Junio C Hamano
2018-07-27 13:02 ` Jeff King
2018-07-27 9:40 ` Jeff King
2018-07-22 5:48 ` [RFC PATCH 3/5] pack-objects: add delta-islands support Christian Couder
2018-07-22 8:55 ` Duy Nguyen
2018-08-05 17:28 ` Christian Couder
2018-07-23 18:52 ` Stefan Beller
2018-07-24 9:58 ` Jeff King
2018-07-24 17:20 ` Stefan Beller
2018-07-27 13:13 ` Jeff King
2018-07-27 17:22 ` Stefan Beller
2018-07-28 9:00 ` Jeff King
2018-07-28 12:12 ` Christian Couder
2018-07-24 17:03 ` Junio C Hamano
2018-07-24 17:11 ` Junio C Hamano
2018-08-05 17:40 ` Christian Couder [this message]
2018-08-06 8:44 ` Christian Couder
2018-08-06 13:58 ` Jeff King
2018-07-22 5:48 ` [RFC PATCH 4/5] repack: " Christian Couder
2018-07-22 5:48 ` [RFC PATCH 5/5] t: add t9930-delta-islands.sh Christian Couder
2018-07-24 10:24 ` Jeff King
2018-07-24 10:16 ` [RFC PATCH 0/5] Add delta islands support Jeff King
2018-07-24 17:18 ` Junio C Hamano
2018-07-24 21:14 ` Jeff King
2018-07-26 13:34 ` Johannes Schindelin
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=CAP8UFD2Ri6N33UhZSHOvxtxiCBC13-1rpa_ZByY9dsyPjmaC8A@mail.gmail.com \
--to=christian.couder@gmail.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--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).