Article View: linux.kernel.git
Article #4189Re: [PATCH v3 3/4] object-file-convert: match tree, parent and mergetag headers by key
From: Adrian Ratiu
Date: Tue, 01 Dec 2026 11:29
Date: Tue, 01 Dec 2026 11:29
36 lines
11047 bytes
11047 bytes
On Tue, 01 Dec 2026, Patrick Steinhardt <ps@pks.im> 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!
Technical Details
Message-ID:
<87jyltxmqz.fsf@collabora.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76768-linux-kernel-git=dewy.ruReferences:
<cover.1794932695.git.adrian.ratiu@collabora.com> <cover.1795455594.git.adrian.ratiu@collabora.com> <ed6dcdd93dde4294ad940e501b52f44b43d41be9.1795455594.git.adrian.ratiu@collabora.com> <aw6CIb_2kc_f2vAP@pks.im>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!git+bounces-76768-linux-kernel-git=dewy.ru From: adrian.ratiu@collabora.com (Adrian Ratiu) Newsgroups: linux.kernel.git Subject: Re: [PATCH v3 3/4] object-file-convert: match tree, parent and mergetag headers by key Date: Tue, 01 Dec 2026 13:29:24 +0200 Organization: Usenet Network Message-ID: <87jyltxmqz.fsf@collabora.com> References: <cover.1794932695.git.adrian.ratiu@collabora.com> <cover.1795455594.git.adrian.ratiu@collabora.com> <ed6dcdd93dde4294ad940e501b52f44b43d41be9.1795455594.git.adrian.ratiu@collabora.com> <aw6CIb_2kc_f2vAP@pks.im> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: usenet.network; logging-data="1696667"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:M0/7OyANVCtIRZ4Pz1rEjEypisU= sha256:XoaNTy4vsp/cx3m11PvJ1Aw4zGHS4qAAVnFyLhc5TPw= sha1:3yjfM/oushHTaCswWTeBecd6tTA= sha256:ii0Aos0RcZUk5p1fJG7c6nmx52wogMRbywhcZe7IvGY= List-ID: <git.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 4764F117349; Tue, 1 Dec 2026 14:30:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -1.65 X-Spam-Status: No, score=-1.65 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=collabora.com X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qh9BGsjQ8_vi; Tue, 1 Dec 2026 14:30:18 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-76768-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=collabora.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 04E80117336; Tue, 1 Dec 2026 14:30:09 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 00EFC306B8; Tue, 1 Dec 2026 11:30:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796124607; b=ep4oo90NOrl6yyIm0tvrLXwyjEwKIsZYFwtxqKBPJsYPxz+gJINWFohCfDVItgauEu2Q CPVi07MlHbGFpJLZW5XejmEj2a+lW6qDbZG7LIAU3WjprpBdbZshlo+RRh/tpdLGvhJW0 6py0ayMCMadE2VPzQXmMKWvrF2VY+UYypO4h2T+cHyKRO4OGoqJFA9NBAmlkwdjVAuXHc H/BMvCe36ccZxsoltbGwD+56zsrHJYYz6lyOUP40iqEd9HgnEzuYKNoakjiew8EUf+iS6 O9Z/VRajOW4rchEoKvY6YDR8GLrTmZrP2T8srYKLT3L2LYPa+j2ZgU2i4gBWUVXTYhw== X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796124607; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:From:To: Cc:Subject:In-Reply-To:References:Date:Message-ID:X-Mailing-List: List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe: List-Owner:Precedence:MIME-Version:Content-Type; bh=MA/dXuQgHaYdEO6mMUQ1CkZZrTTZTFCUdd/kZI+s55o=; b=HPk20AB6LD8UQNsQgXjy6SJcdT3Eu4HU6hZkUTky58urMtFtbdGFb8Z7evq+gR8mJZRP Em0auMjlchU6ExGZ+rcCbBD4U8xy6LflpGHdUBzmJI4Ov/3jc7tJaIXI3+sOpjkVPfg8/ 2Wl/JaHZbVBN21xEcgXcqnpEgwS3EA9h6tcpsD4m+YaulQkgcdoVv5hL3EY8GEH2S8ouz DTtX28GBrJkhe/odKgw42kbkxLdxQU/mA77wczAoKc/Xs4bNIQyQhG0QTdptPMZY8YER6 QAH2Q+cTs8sTYT2HOvbtn86DtYS37lH5vmqzKl8dv+voOV4ngQB3CzSspYoAD13oH5w== X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=CAj0rkrH; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CB6BB606A320; Tue, 1 Dec 2026 11:30:07 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=CAj0rkrH X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.180.107 X-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== X-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== X-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 X-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 <git@vger.kernel.org>; Tue, 1 Dec 2026 11:30:06 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6B7E4606A32E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com X-ARC-Seal: i=1; a=rsa-sha256; t=1796124573; cv=none; d=zohomail.com; s=zohoarc; b=dbYkQkFkD92bfUK84NZbDpYliGUaK0Pz2u2MmmQfmp5vZzzjGiwsf1Q6DM+S04UqBJQiz5D+ksbn821J2yOGYlp7X4+rC2yAxd6k3ZyEN7WjoIjKQx8ndziRcgYTDHwvWJiW/84phV4YkYvR83gdohyLWXfHKiiZXUJZ6bj09fM= X-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= X-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=<adrian.ratiu@collabora.com> X-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; X-Received: by smtp.zohomail.com with SMTPS id 1796124571066373.9891582731658; Tue, 1 Dec 2026 03:29:31 -0800 (PST) X-Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>, "Eric W . Biederman" <ebiederm@xmission.com>, "brian m . carlson" <sandals@crustytoothpaste.net> X-In-Reply-To: <aw6CIb_2kc_f2vAP@pks.im> X-Mailing-List: git@vger.kernel.org X-List-Post: <mailto:git@vger.kernel.org> X-List-Help: <mailto:git+help@vger.kernel.org> X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:git+owner@vger.kernel.org> X-Precedence: list