git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Unexpected recursion in 'git rm'

From
Matt Hunter <m@lfurio.us>
Date
Jul 3, 2026, 13:04 UTC
Message-ID
<DJOYGY682OLT.1TPZHGTA5EMQQ@lfurio.us>
In-Reply-To
<1978773121.20260703123754@gmail.com>
On Fri Jul 3, 2026 at 5:37 AM EDT, Евгений Плискин wrote:
Show 7 quoted lines
>> Hi - I threw a quick test repo together, but did not see the result you describe.  Could you produce a script or series of commands to reproduce the problem?
> Hi. Thank you for your reply. 
> I was advised meantime that indeed this behaviour is expected:
>
> 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":

Yup, I see that now, and that was the difference maker in my test. I had json files in the directory I was working, as well as at nested paths. My (non-windows) shell globbed to pass just the upper files.

To address Patrick's question in <akdzSHrJ4DfdUWoS@pks.im>:
> Could you maybe clarify which part of git-rm(1) made you think that this
> wouldn't happen?

I'll say that I _don't_ think the man page is unclear in this regard (having given it a look just now). To me, this is just one of the aspects of git that is integrated with its unix counterpart well enough (git-rm vs. rm) that you can forget the finer details like this fairly easily.

And since the command is so straightforward, I couldn't tell you the last time I pulled up git-rm(1) as a reference.

Previous: Patrick Steinhardt
Message 8 of 8 in “Unexpected recursion in 'git rm'”
  1. Евгений ПлискинJul 2, 2026
  2. Matt HunterJul 3, 2026
  3. Patrick SteinhardtJul 3, 2026
  4. Phillip WoodJul 3, 2026
  5. Mikael MagnussonJul 3, 2026
  6. Junio C HamanoJul 3, 2026
  7. Patrick SteinhardtJul 3, 2026
  8. Matt HunterJul 3, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.