From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.180.107 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796124607; b=uFfdSdsm5BeuaKPrxEopXp8Dk5d5e7Ns5Ro0nl1GDYrj0AqH+YqeGgd2iEeY7pY/NQBx XcyeqywqtN48/lIwaQOqfl4JMUCiBnBcY7GcRAySeIZSNsuazqvQc1YVEpaNludA2PfeU WKyfv3GxmtdAy9ikL4zxXzhyhloLCUFDL4R7HQi9hCt6uNc8T5kg32D5hS2eNsEl6auY3 nCj87l3thrtGSnJy2x0aTgVM+KZ35qiiSnJsigM8VGpcCo9BV7h4oo/EXiVr8h/6y5dpB p4sdT6hXyc6L+KWNtb0Kr82GT47eDghsB0YtQ/Zj9ia+iNt7STvazTK8g+qlKQsp23w== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796124607; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:In-Reply-To: References:Date:Message-ID:MIME-Version:Content-Type; bh=MA/dXuQgHaYdEO6mMUQ1CkZZrTTZTFCUdd/kZI+s55o=; b=rxAdS33M0ab8WqUqDEWM35tcaweFpeNaBoPr6sCURlSxNeH16OJFL+Zjlncx9kcLYpTK 7XZD9SdCgHwpq0ZpM8DGl1fBtFe7hSRlS9Wszv9isXJ7+UxLsuc+Uj8kSrKBI08h9aTfo 7o04puGI8Qj4ek9FXcvrPbDbc/p08fbkgu+dp1u8NPTFuyhnLZClR+9foKiZgS6NgNfpH qbXxzxEpVIi9JN3yhX9JccDRvNmV4ue7GtmY/FF4s++sHQmAwSb/w5zqMZYgZb8BMMD+B Qwq4sCGY8xAPTk8F46m1T6hlZ3fggx+OoTUNZ/75NxSMemA2eDcL0O39pgyJ4SB2dlQ== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=CAj0rkrH; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.180.107 Received: from sender6-pp-e107.zoho.com (sender6-pp-e107.zoho.com [165.173.180.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B7E4606A32E for ; Tue, 1 Dec 2026 11:30:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B7E4606A32E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=CAj0rkrH ARC-Seal: i=1; a=rsa-sha256; t=1796124573; cv=none; d=zohomail.com; s=zohoarc; b=dbYkQkFkD92bfUK84NZbDpYliGUaK0Pz2u2MmmQfmp5vZzzjGiwsf1Q6DM+S04UqBJQiz5D+ksbn821J2yOGYlp7X4+rC2yAxd6k3ZyEN7WjoIjKQx8ndziRcgYTDHwvWJiW/84phV4YkYvR83gdohyLWXfHKiiZXUJZ6bj09fM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1796124573; h=Content-Type:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=MA/dXuQgHaYdEO6mMUQ1CkZZrTTZTFCUdd/kZI+s55o=; b=Epu6NFSGYeJ3kcAzx2s29oFhPaKADHS5rFjsQMXZdLiGiGRebbsERo+vkKixiprscapx7hS0pTkmMtFBLdJVTFZkuycRkOJ2XtUiWclc7ihh+OhP5j23wuIPlLSJXFAe21TQBUhNBhyxjmYYeIAT28M3Dmr3diXTOkZPcCfPxG8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=adrian.ratiu@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=CAj0rkrHir6J0V8LC3MbIJYETVD/Ca+OOrjbDl92p4jwCm1n04b6TMJm+K6ZUd/uwJoVQ3Tq50yjtFRZK5pruRF29OBdKLbousbnUcEnPGbQUGxpcLDFEAVOlCz8fnyL0kMn2AyYsdZg3C/ZicPdItRPL7sva/k39X7O/Vi/Rds=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=MA/dXuQgHaYdEO6mMUQ1CkZZrTTZTFCUdd/kZI+s55o=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1796124571066373.9891582731658; Tue, 1 Dec 2026 03:29:31 -0800 (PST) From: Adrian Ratiu To: Patrick Steinhardt Cc: git@vger.kernel.org, Junio C Hamano , "Eric W . Biederman" , "brian m . carlson" Subject: Re: [PATCH v3 3/4] object-file-convert: match tree, parent and mergetag headers by key In-Reply-To: References: Date: Tue, 01 Dec 2026 13:29:24 +0200 Message-ID: <87jyltxmqz.fsf@collabora.com> X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain On Tue, 01 Dec 2026, Patrick Steinhardt wrote: > On Mon, Nov 30, 2026 at 03:43:24PM +0200, Adrian Ratiu wrote: >> convert_commit_object() only enters the "tree ", "parent " and >> "mergetag " cases when something follows the space. >> >> A line like "parent \n" falls through to the final "else", which >> rejects any line it does not know. >> >> The next commit makes that "else" copy unknown lines unchanged. Then >> "parent \n" would be copied into the compat object instead of being >> rejected. Worse, a "mergetag " line whose tag starts on the next line >> would be copied together with the unconverted object ID in that tag. >> >> Use "<=" instead of "<", so that these lines enter their own case and >> are rejected there. >> >> An empty "tree " or "parent " fails the length check before >> parse_oid_hex_algop() is reached. An empty "mergetag " leaves a tag >> that doesn't start with "object ", which convert_tag_object() rejects. >> >> This doesn't change behaviour: these lines are rejected as before, >> only now with an error saying why, e.g. "bad parent in commit". > > This almost feels like we could've added some tests to verify the new > behaviour. But on the other hand, I'm not sure it's worth it to verify > that we have a slightly different error message now *shrug* > > On the other hand, the mergetag change sounds like a potential > regression that could have been introduced by the next patch. So maybe > we should at least add a test for that particular part? Yes that is all correct and we do have a mergetag test in patch 4, I just forgot to move the test here when I split the code from patch 4. :) I'll move the test here and reword to clarify. Thanks!