All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Patrick Steinhardt" <ps@pks.im>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Han-Wen Nienhuys <hanwenn@gmail.com>
Subject: Re: What's cooking (draft for #4's issue this month)
Date: Wed, 14 Apr 2021 14:20:09 -0700	[thread overview]
Message-ID: <xmqqeefcy35i.fsf@gitster.g> (raw)
In-Reply-To: <YHa5NE3tj/R5kF8N@ncase> (Patrick Steinhardt's message of "Wed, 14 Apr 2021 11:43:16 +0200")

Patrick Steinhardt <ps@pks.im> writes:

> On Tue, Apr 13, 2021 at 06:11:39PM -0700, Junio C Hamano wrote:
>> On 'seen' there are many topics that have not seen adequately
>> reviews; some tests are broken near its tip (I think they pass the
>> selftests by themselves).
>> 
>>     0e76df05ca Merge branch 'ps/rev-list-object-type-filter' into seen
>>     956fbceb2e ### breaks 6112 6113
>>     c007303ad4 Merge branch 'bc/hash-transition-interop-part-1' into seen
>>     4813f16161 ### breaks 0031
>
> Test breakage for the rev-list filter series has been a bad interaction
> of d8883ed540 (object.c: stop supporting len == -1 in
> type_from_string_gently(), 2021-03-28) and
> ps/rev-list-object-type-filter.

Yuck.  The commit d8883ed5 (object.c: stop supporting len == -1 in
type_from_string_gently(), 2021-03-28) by itself may have meant
well, but in an environment where concurrent group development is
the norm, it is a change that can unnecessarily break other topics
easily, like it just did.

Perhaps a band-aid like this may be necessary.

diff --git i/object.c w/object.c
index 68de229f1a..b4bde9e444 100644
--- i/object.c
+++ w/object.c
@@ -39,6 +39,9 @@ int type_from_string_gently(const char *str, ssize_t len, int gentle)
 {
 	int i;
 
+	if (len < 0)
+		BUG("type-from-string-gently no longer allows unspecified length");
+
 	for (i = 1; i < ARRAY_SIZE(object_type_strings); i++)
 		if (!strncmp(str, object_type_strings[i], len) &&
 		    object_type_strings[i][len] == '\0')

> The following patch fixes this, which
> I'll include in my next reroll of this series.

Thanks.

> diff --git a/list-objects-filter-options.c b/list-objects-filter-options.c
> index 19e128ef11..33c7718a7a 100644
> --- a/list-objects-filter-options.c
> +++ b/list-objects-filter-options.c
> @@ -100,7 +100,7 @@ static int gently_parse_list_objects_filter(
>  		return 1;
>
>  	} else if (skip_prefix(arg, "object:type=", &v0)) {
> -		int type = type_from_string_gently(v0, -1);
> +		int type = type_from_string_gently(v0, strlen(v0));
>  		if (type < 0) {
>  			strbuf_addstr(errbuf, _("expected 'object:type=<type>'"));
>  			return 1;


  reply	other threads:[~2021-04-14 21:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-14  1:11 What's cooking (draft for #4's issue this month) Junio C Hamano
2021-04-14  9:43 ` Patrick Steinhardt
2021-04-14 21:20   ` Junio C Hamano [this message]
2021-04-14 21:53     ` Junio C Hamano
2021-04-15  9:37       ` Jeff King
2021-04-15 18:02         ` Junio C Hamano
2021-04-14 21:31   ` Junio C Hamano
2021-04-14 23:22 ` Junio C Hamano
2021-04-14 23:26   ` Junio C Hamano
2021-04-15  0:34   ` brian m. carlson
2021-04-15  6:37     ` Junio C Hamano
2021-04-19  2:10       ` brian m. carlson
2021-04-19 23:14         ` Junio C Hamano
2021-04-15 12:58   ` Han-Wen Nienhuys

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=xmqqeefcy35i.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=hanwenn@gmail.com \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.