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

Bug: Git sometimes disregards wildcards in pathspecs if a file name matches exactly

From
Piotr Siupa <piotrsiupa@gmail.com>
Date
Apr 11, 2025, 19:08 UTC
Message-ID
<CAPM0=yBnaXojeC9WkHg08deR-VpjaVQwyrqt8mk+54qLXqSaAQ@mail.gmail.com>

Hi! I think I've found a bug in the command "git add". It can be reproduced in a fresh repository by running:

git init touch 'foo' 'f*' git add 'f*'

The last command should add both files "f*" and "foo" to the index but it adds only "f*". Running it the second time works as expected. (It adds "foo" on the second attempt.)

I'm using Git 2.43.2. The current "next" (2.49.0.805.g082f7c87e0) seems to have the same behavior if I'm testing it correctly.

Next: K Jayatheerth
Message 1 of 5 in “Bug: Git sometimes disregards wildcards in pathspecs if a file name matches exactly”
  1. Piotr SiupaApr 11, 2025
  2. K JayatheerthApr 12, 2025
  3. JAYATHEERTH KApr 12, 2025
  4. Jeff KingApr 12, 2025
  5. JAYATHEERTH KApr 12, 2025

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.