From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 937083C4565 for ; Fri, 3 Jul 2026 12:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783082393; cv=none; b=n1T6rXNUWO6w9zsc1mTXkrPc4DYAgguAA6WTUslXI6tzuRlZbS9hP2g/bYYM2URWwRpE5PNKt2ZK07B0qwYFxRmkwL2Unp69Ir2fawpHwwz3vlawc4xkLHAcXTqbWeRTHCxvQIpEEaAVq2KiEc5pYUF/CWnDuMaPZRmQgx80JOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783082393; c=relaxed/simple; bh=p6MhTnAzQj8qY0ioGRtQ+h3rMWXUZsSmGYp/iF1iWzc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=A2m0KbzLswroFMwG9cZXPJyBNyg2oyOMzKQAZmet2ll2Ms3XLqS0C32XvwnGNibG4slRmsHtWjALCNJOLUpanTcDKxtE0i1W9TiptE4zyy5qj12/tsP+4SxH+8J81nc1VlOf9dY8Ruf/whnDglLY0/AaaGWxsnf/AlJ5QaHW17s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=lGUcrN+y; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ZP0a8Vik; arc=none smtp.client-ip=202.12.124.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="lGUcrN+y"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZP0a8Vik" Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42]) by mailfout.stl.internal (Postfix) with ESMTP id C97AA1D000C7; Fri, 3 Jul 2026 08:39:51 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-02.internal (MEProxy); Fri, 03 Jul 2026 08:39:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-transfer-encoding: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=1783082391; x=1783168791; bh=dnNhClWDREwPk1U2zIz41F6XprAv6qfhohosA3IyvUE=; b= lGUcrN+y9KTSkjE5knulvtaVLQkSUvfx2vnvbnOcB8oBoPZ/g0o36XsXgakv+NDN EKi1MqrZVvLSt7t4jwlQykgJSGaOp+0CVCOIrCZD2QFSZlxEVVkK22k7/SQmDJ0R MamSiDJp8eummVH32O0dojs+SSYVWsq+Hx1UP4b8XqUFWFcMTSrZRocXCgZhRtCI T3l4i9XJw3eTm/cVX3MgDKvR/hdBQnAvKdVKtN+y6LP07CZKw5BrNQT8T6JtNr3S OVer7fRUHHL9NEqETJPlgLsXUC4Q5wJzE0qPyi9a28pJKd1dRcZYgPJyEchVAaUU snoXG5nGw2NfVVtQ87IY+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :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=fm2; t=1783082391; x= 1783168791; bh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ZH1Clqc4UoP8ZJ4Ej+xPasxJ5VF+qK8Xvy7+1w+Gz19KtIKPAKYw X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 3 Jul 2026 08:39:50 -0400 (EDT) Received: by mail (OpenSMTPD) with ESMTPSA id 6bfcf60f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 3 Jul 2026 12:39:49 +0000 (UTC) Date: Fri, 3 Jul 2026 14:39:47 +0200 From: Patrick Steinhardt To: =?utf-8?B?0JXQstCz0LXQvdC40Lkg0J/Qu9C40YHQutC40L0=?= Cc: git@vger.kernel.org Subject: Re: Unexpected recursion in 'git rm' Message-ID: References: <323134122.20260702104910@gmail.com> <1756071445.20260703123414@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1756071445.20260703123414@gmail.com> Adding the mailing list back into Cc. On Fri, Jul 03, 2026 at 12:34:14PM +0300, Евгений Плискин wrote: > > This is expected behaviour, as the argument to git-rm(1) is a pathspec, and "*" matches directory separators by default, see also gitglossary(7) under "pathspec": > > • the pathspec up to the last slash represents a directory prefix. The scope of that pathspec is limited to that subtree. > > • the rest of the pathspec is a pattern for the remainder of the pathname. Paths relative to the directory prefix will be matched against that pattern using fnmatch(3); in particular, * and ? can match directory separators. > > For example, Documentation/*.jpg will match all .jpg files in the Documentation subtree, including Documentation/chapter_1/figure_1.jpg. > > Could you maybe clarify which part of git-rm(1) made you think that this wouldn't happen? > > Thank you for your reply. I believe you are correct. > > I have made more research and found a way to remove files in current directory only without recursion into subdirectories: > git rm -n ':(glob)*.json' Yup, that wouldn't cross directory separators indeed. Patrick