From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796169471; b=wMshoaIH6l6TFWpKctUbDA8jIzRZtsfWcDa0IPeOEOsmHDk3O8zXXjc53MPj0yIar3OA 3s+S898NLryBsey39wv/6bsA5WEYbHsyGKQOYQzfYoiM4OS5PAYLGkMw2KpPW4JCZpiRO JrbvDNacA+8TldUDwT/s9hXiabjgGoG89miRCJXsP3y0LCl9NZXL4l4AtzG5F8AbRQ/DK skVKAZx0TkcAImM+Wi7DezIM0z+kHrx1coAneqkiTZc1CMJrIH50jvFDOgVeiJn5XG30e yPnSCzK1t6SoheQca5C6Hm3W6sx3oueVLx8bKdHH2G5t/vlvU20g+HpXemaKx0tdktg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796169471; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Sender:Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc: References:Content-Language:From:In-Reply-To:Content-Type; bh=EY1ynwsusX7kFvoBGPcVHkL3iAyVOYyQmz5us3xoJNo=; b=pkqowPgY/tw5OqJbJX/KC/q0FV+ulSQwLzBVY/1j6DQFbs1oNbncKANY5Z1RUUE2gi+i gWxqvbIwmxlNggKYVrOl3j/Rd+5kbOIGwS+BhdaTMiyKQ08NlP8/NmeVT+svLEM8ysg9o cjlS+PSY71e8yDnMfkLq7wxP/fJ2h4hdi6Z2VOqvMYyTA3JFhXWw9P1CTNXI8mrrG5l5O xRdJTSdLXzDyAbZjvt7E6GtRvyyL4zwfg5LAtRuqLGEMb82wovVbJ6uq/WUEzsQ85RNIq h1Hp+64m2L0h/E4OnWreYusv1WetNJp4RFGStOmYHqzx2tsCcNAXfwBacjoCK89LUXw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lqVQdXR3; arc=none smtp.remote-ip=209.85.221.52 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 188EC606A322 for ; Tue, 1 Dec 2026 23:57:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 188EC606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lqVQdXR3 Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-4a9be758734so7891121f8f.1 for ; Tue, 01 Dec 2026 15:57:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796169469; x=1796774269; darn=vger.kernel.org; h=content-type:in-reply-to:from:content-language:references:cc:to :subject:user-agent:mime-version:date:message-id:sender:from:to:cc :subject:date:message-id:reply-to:content-type; bh=EY1ynwsusX7kFvoBGPcVHkL3iAyVOYyQmz5us3xoJNo=; b=lqVQdXR3CIaYit1/cP/fH5yke1kyACrjhFlV57T4cH/1/gY46QLCyo338BvehshiqY DNCMONfVCzME9CrGVNI60Fymtb+NX68gxVkC+OT94GnjxB/2DjqhjoXhL1GHgs9EBAjR VAxCLt7HxTdKWk5jg+Azmqdx+XQnKbKAl4XrUjS7mM+lo8+bU/NzcyZLCYXWzoJNYO5r FWmlVOH4ZKs/eQ1FxHkxR7EYhQd36eKqqHdkpP64mtEc4fergT4jZyU7zi5w9K3ne3/z gp0vYB4YS/5n5YP6qYBOTvruRwlz/aZwfQKcqHDqrFAwfjWExKmDGVZ2SrsnxIbZLhYX WLfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796169469; x=1796774269; h=content-type:in-reply-to:from:content-language:references:cc:to :subject:user-agent:mime-version:date:message-id:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=EY1ynwsusX7kFvoBGPcVHkL3iAyVOYyQmz5us3xoJNo=; b=GsxqspHEl13MH5QQIGE8hMC0nA8mmpRi6enZpSlGjK73Xa/zLecVKskNDMdCGsh7iQ jI627uMRhL7U6WhoIsePYgnJs0nGYW23TxgMJ82lFwgG9uy/SLHZPQ/XL8d5h9UpZeMG ynv3ljAMiN/w7KSPAHNnKcWEX8al4ZWLVGGolxJtaTa1CCjFqgh/CpJLtyhlyypaYrSZ +mCJHwmYJpxLwwb/FJlHAzNCdHV86G4u/dCZfg07aMtCSf9X9A6xRnilLSofLkGAJGbw 5lF+ei8rT6kvhM7q+OJ5G/ogqvw7IdB75BoMc4gaoaIdHV+alaybcxq44sYHBnnf7ERZ 0dag== X-Forwarded-Encrypted: i=1; AL+hErHzFqkUmialP7vzloTevyrISiRwWDfysOAsgI2KPIT1QmOpZ4hkReTeUvzjC0maQBICnSsnwJroZ+Vtnls=@vger.kernel.org X-Gm-Message-State: APuU4Z+2QhpzxCn2NeRu3Kp62Pu5tbpnlIzWmDVMzsIG3bQJoIzaC8bP hhT6sC0rSUWlH7rDTw9hid45rEwRMwdZZ8C+X/T9nG+3w/cP2I/+yLvWSO81rF92sho= X-Gm-Gg: AZFdTZdShdjUVGujhooMoZBFHJQrnD0BztquzVrUjHR4a6fr7uKYW4vsT88SniU1D/j jnaGc0JolebVITcvGZsLsSOJlRDBPr0/hzpepYwljo8HnqvKsnfp3sY87LxEmWd4xv/cFrUIvok DaIA8U4gxzgD+E3CqsomrvaPmux60/ZNA7nwcBDzTDKRhT0TmzLdcnwvZabAaY6/lcBSKJHZsKd DQfza9K89i6ObjeXKi4L/i072FOFfSDu6b3KIbVlHjkOlnuaKmwFz+ekCmyLRy9Jd4l/b2LZyro OCTS+otBXd5ao+DECGX0gShjUjdtg2t416c7krVPL6NsQ5pnmtn20DLi379DSE8tFizJGeHkJBG a68e16f5Ygu1Ke/wpQE/wv882hvue0v2Ma1clnciDrfsnYJWmi/mOeuZOrRvrRHKtGwvN8TOrkm ihp10h+LYWCZVOHLWMyA8gYcyV7GgrQUZf/vm+A3fgsEvP0GYkESeIeLQjSmikX1FC5eqW5CA48 rc+Xa6lqoVgII0ZnPvg/T436sx76w4l8RwdNz5NkemMIj5kJiGCO4oW+kyk5f5BigzV44bLZFpU qy3RfM1j/onIxiWl5Jb0THh/5hIYUz0luoimyCa3gkGskTih82UkN9mFc2LgbsC9U41iYdvMLKd J2Vw9gxrZeWv76a3xwJyw X-Received: by 2002:a05:6000:299c:10b0:4ab:7c3:105 with SMTP id ffacd0b85a97d-4abb00d6ed6mr53145016f8f.22.1796169469347; Tue, 01 Dec 2026 15:57:49 -0800 (PST) Received: from [10.128.10.232] (195-23-151-163.net.novis.pt. [195.23.151.163]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6a67fec7sm70001528f8f.26.2026.12.01.15.57.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 15:57:48 -0800 (PST) Sender: Julian Braha Message-ID: Date: Tue, 1 Dec 2026 23:57:47 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] kconfig: diffconfig: preserve a final line without a newline To: Hamdy Abou El Anein , nathan@kernel.org, nsc@kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, sam@ravnborg.org, tim.bird@am.sony.com References: <20261201220103.12350-1-info@daylightlinux.ch> Content-Language: en-US From: Julian Braha In-Reply-To: <20261201220103.12350-1-info@daylightlinux.ch> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------cc0j0KRDf6COwsqpOWypp1V6" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------cc0j0KRDf6COwsqpOWypp1V6 Content-Type: multipart/mixed; boundary="------------0a4H4O30bBl6ftPrGnyydt4X"; protected-headers="v1"; hp="clear" Message-ID: Date: Tue, 1 Dec 2026 23:57:47 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] kconfig: diffconfig: preserve a final line without a newline To: Hamdy Abou El Anein , nathan@kernel.org, nsc@kernel.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, sam@ravnborg.org, tim.bird@am.sony.com References: <20261201220103.12350-1-info@daylightlinux.ch> Content-Language: en-US From: Julian Braha In-Reply-To: <20261201220103.12350-1-info@daylightlinux.ch> --------------0a4H4O30bBl6ftPrGnyydt4X Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/1/26 22:01, Hamdy Abou El Anein wrote: > readconfig() unconditionally removes the last character of each line. > If a configuration fragment has no terminating newline, diffconfig > truncates its last value or fails to recognize an unset option. >=20 > For example, comparing CONFIG_FOO=3Dy followed by a newline with the > same line without a newline reports a change from y to an empty value. >=20 > Strip only the newline instead of removing the final character. >=20 > Tested with identical and changed values, unset options without a final= > newline, and regular newline-terminated files. >=20 > AI assistance: ChatGPT identified the bug by inspecting the script and > prepared the fix, commit message and local regression tests. >=20 > Fixes: a717417e7f96 ("kconfig: add diffconfig utility") > Signed-off-by: Hamdy Abou El Anein > --- > scripts/diffconfig | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/scripts/diffconfig b/scripts/diffconfig > index 43f0f3d273ae..9e84288e0d1f 100755 > --- a/scripts/diffconfig > +++ b/scripts/diffconfig > @@ -40,7 +40,7 @@ Example usage: > def readconfig(config_file): > d =3D {} > for line in config_file: > - line =3D line[:-1] > + line =3D line.rstrip("\n") It would have been better to just do: line =3D line.rstrip() to catch any trailing whitespace too, not only newline characters. > if line[:7] =3D=3D "CONFIG_": > name, val =3D line[7:].split("=3D", 1) > d[name] =3D val > -- 2.56.1 >=20 But, this is an improvement over what we have, so: Tested-by: Julian Braha Reviewed-by: Julian Braha --------------0a4H4O30bBl6ftPrGnyydt4X-- --------------cc0j0KRDf6COwsqpOWypp1V6 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature.asc" -----BEGIN PGP SIGNATURE----- wnsEABYIACMWIQT6qjll++tIFxF8TUPElYPCBXNxIAUCaw9e+wUDAAAAAAAKCRDElYPCBXNxIGAc APsHqsh2EciGOlpH0rhgeGDP8Tx3WbzgmB8+anywAkXxEQEA+VYaO0aH1Lm/NwukYWbAOYfMfy45 AEB6gFxub1HABAE= =IS/b -----END PGP SIGNATURE----- --------------cc0j0KRDf6COwsqpOWypp1V6--