From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.147 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795924864; b=BSuJjqltpU68mRHmdskJWhBTaX+KY5swNngkdaCtaZbW6doE4DVOHXQ9SFS04YOsk0xB rSs/s1JYLCuIvYEmos/OomzlPknl64ydK4wjb1KLKXs1R0Pr51iAuSZqFStBYEBskZflr ct/PkGa14Q0XccwwsRT+pIz4+EkXPldzm2NY+MoRJB003eVnH7iYSSSBZy05ZhKwk5oyZ z/LaS/grCiMrfyulkLAwHeCVMlTxU9xUOBL1ctUedvRAqFDMT1OmiDl7HyRgrZN1Q/kZ/ VYuok7t9WEXYMa/WzOW+h1enbj9mw6NS7AzNzgxqWIycDEq81WRjxrrhc/tyniM3qdQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795924864; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: User-Agent:MIME-Version:Content-Type; bh=6Ke5jCU4Bx2w3hJJLhdlqSEtoAU3Tdg0wUpu3VWiYCw=; b=rI5Pxv2o9uDaa241VPPn/8biQPteL+kgt5Njp3czQK7MSMO+k5ANIglls0In+gk0ThUg mB2fJpEf12TS4FtFb8Bo6eGj5S5mE82LA/rn5G6+vIZ5BR4rqx9SiXI+gFwucuaHR7nRG 5OhgqAt3uZengs6T+MvJ8hMBDKxF56oetyHulSP0qAVjykonLlprVP0lHlmX2wkMl2KwP 8k2ED+1IAvUozgSRPyZIcbatbp+O3hwENrt5wJboLcJNnc2p10fluKS2WHMOVwZ3bxU7o Izp6zhX345vPcOvgpszEar+Uipq39rbGmnltjBYv97CwLBQ2P1JHpiciL++j3+5xaVg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=atfxZUJw; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=3gjQZo1K; arc=none smtp.remote-ip=103.168.172.147 Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 BCB0E606A326 for ; Sun, 29 Nov 2026 04:01:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BCB0E606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pobox.com header.i=@pobox.com header.a=rsa-sha256 header.s=fm2 header.b=atfxZUJw; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=3gjQZo1K Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id D3BFBEC09E2 for ; Sat, 28 Nov 2026 23:01:02 -0500 (EST) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-04.internal (MEProxy); Sat, 28 Nov 2026 23:01:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1795924862; x=1796011262; bh=6Ke5jCU4Bx 2w3hJJLhdlqSEtoAU3Tdg0wUpu3VWiYCw=; b=atfxZUJwG8iAsowI9CsbChq6n4 weg8k2TdKSkoO+HCL2ttkLZs1G7CsQ9ek/MEWHmLsOm2bbHrNS8phgSn5StoB+Sf S+gHooVLn4qVFyP/zFnvFtY4B1Nv16H8m5orzXQYGukFLae52i7ynpAT1Qem25yD aq79+ToXBGQJ0NAZs+W/WalubEcGel4Py0+4wTwviP+ijzulaHQFsaesV9K8gTPy T3xd6RSUuW3e0+mnAmbHzOPJ1MXVMqLH8zfM7O8A+2VrktvXtHmtBjvrDMNBksdu WDTlLX6lAuvzs18Sw9DL/S7bWbxGo1pLIlwuCPblr3uY9MdmNmnehl2rpPKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1795924862; x=1796011262; bh=6Ke5jCU4Bx2w3hJJLhdlqSEtoAU3Tdg0wUp u3VWiYCw=; b=3gjQZo1Kvv7KPpqbgKGSKmrE4RxIOWPrbPyBPT61jODz+Zbauvs Oil6m+qT/RxuIvN0zBtBQpdA+kz0HDjRVp2dgMGwdNw8MXmTc12B4gbPUcGuMvtA wFZVJBJcwIcWgq0gMTZ+7hWBOWH5lDngovPw5rEAzPvTAB9QvzT77CNaUDhXaM+0 o2RwdkTZwJU3XMykiXbspbB0zI96GDhitvU04bjwDrTjOORdq7IUCImBr6KwlQvN EWgssRa40eVP0qyMg6LChf5nh1f2ref8/4HuvNxsOUpnVzU1UR+n7Z8sGR7pdgDV N/6ZKyAFG2p6PRe2ZklnpqUA7F6ZKOElfjg== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pobox.com a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1795924862; d=pobox.com; mf=PGdpdHN0ZXJAcG9ib3guY29tPg==; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm2:rsa-sha256:QnlVIopvlOfRCjEUFiEzTYoQqqAazMryJ9+Z2wQI3G+5buK ZFH1Op6Ep3klzFeECDQ5bbXY8speuGCTo0HpKUYo4U/cvMQB78dgBbqkC66vic5a nEojV2M1KgQ8IQocH/F5Kl8ZdjRZMqfwkBPxcO3dR2d9m+BgjSL9bsuisVbQvdHW JemCAZA7OyUPnfDVbQShmRLRGLMebPxsNVUz2iAqAxhrGZZXIu8FUl06aDnoYAB8 uS1XWFMY95nBl6VMs/hA55WuNCi9e/xnPZTN+USxWbOZtk/ltBwzHR1oSaxpg5vM GORwK9gu7739fkj4mBMfsAOO7qQ6TykyVEDy44Q==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to,user-agent; Message-Instance: m=1; h=sha256:YfrEPCxMgWW5nMSQPW0WfbEHJUYswD8HPDy++qfmyPA=:KcG6ngVko2zrK37l3QF3fgCscjksWGPlcfNUZtticuI=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTG05SqS6W75r0W1jrQv7+d4ONDMD6ykIJfY4mBzw3meEcwUqtDq2bS08++cgyDhDe hWk0ADHf0ofqbz5sB169D2kfsrwDrmo5GhQ1ATnVdVhk3imfBraFcEOKrn1QGie6PojXs/ BEXW8PCr2PPL1WeFk2WG8OJ0l2DjKCPVqn0wvf5gEmqjA1nFvN4VYEvO/LspMzr5CeDMY1 A1b4ly7PLV7SfTvWWuqDzzxLo05yEaB1/BSGCsjHU/GK2+fSwvOhgyVHtK8OwVtmat2xRu wQRbDa2jPdQv5muWUshPnHNIKK2aKDDGTo1QueTW70XVy1m/3yL6twko4zphZbJPHjryFA 7aNaUMuGoCyM70UYwHs2Gi+FzsgcX6rFqV3XQsTIgqANWyY6IrfGEsm4HGAWVURu5ton0N SZAJq4LucuQVE4k3v+r6U1J19t/dugtyWntxLZUpthL+98lwLfnicb3DY+i0T1nl1ZYrcl RtGgOjF0C4WruHTqjRKJvjcNJiOFkK9qVzqtJEF2qDiYQME1gdrub5UQcUkCQ41n5pmIlP Z47Mk8O5QKEOhABNsqrRZHOQ8ewQu7bTtLVMm4IKrI0T7CHwVj3UMCugUiWq18t8ptmvQJ HpNIPOMO6yij5IS8wGdiTNxnDYlrgyZE5EETEWjgo8u/VQqotp/qCTnoWqtA X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 28 Nov 2026 23:01:02 -0500 (EST) From: Junio C Hamano To: Aniket Gupta Cc: git@vger.kernel.org, Mike Beaton , Matt Hunter , Phillip Wood Subject: Re: [PATCH] dir: do not turn blank ignore-file lines into patterns In-Reply-To: <20261128072839.75270-1-aniketgupta3001@gmail.com> (Aniket Gupta's message of "Sat, 28 Nov 2026 12:58:39 +0530") References: <20261106182945.1316297-1-aniketgupta3001@gmail.com> <20261128072839.75270-1-aniketgupta3001@gmail.com> Date: Sat, 28 Nov 2026 20:01:01 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) 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 Aniket Gupta writes: > There still is, by quoting the spaces with backslashes. "\ \ \ " in an > ignore file ignores a file named with 3 spaces, with and without the > patch. An unquoted line of 3 spaces never matched it as it is trimmed to > nothing. Nothing is lost. > ... > I will describe it in these terms in the log message. Apologies if I was > unclear before. Tracing through dir.c confirms the issue, and the clarifications you gave in these messages can be used to make the log message describe the issues clearly. The commit message could be rewritten along these lines, dropping "blank" in favor of explaining how "\r\n" and space-only lines turn into "", like dir: ignore CRLF-empty and space-only lines in pattern files add_patterns_from_buffer() skips a line before stripping '\r' or trailing spaces when the line starts right at '\n'. A two-byte "\r\n" line in a CRLF file or a line containing only spaces is not empty at that check, so stripping '\r' and calling trim_trailing_spaces() reduces it to an empty string "", which is then passed to add_pattern(). parse_path_pattern() records that "" as a zero-length pattern with PATTERN_FLAG_NODIR. Normal directory walks via treat_path() and prep_exclude() strip trailing slashes before matching, so commands like status and add are unaffected. However, normalize_path_copy_len() preserves a trailing '/' in pathspec elements passed to "git check-ignore foo/", leaving an empty basename after the slash that matches patternlen == 0 in match_basename(). In addition, cone-mode sparse-checkout feeds add_patterns_from_buffer() into add_pattern_to_hashsets(), where a zero-length pattern warns and disables cone matching. Skip calling add_pattern() in add_patterns_from_buffer() when the trimmed line is empty. or something like that, perhaps?