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

Re: [PATCH] t3706: Add test for wildcard vs literal pathspec

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 16, 2025, 16:00 UTC
Message-ID
<xmqqcydchz9o.fsf@gitster.g>
In-Reply-To
<717161C8-497D-42C7-8C10-AC112238EEFD@gmail.com>
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> writes:
> So, if I'm not doing anything wrong, it looks that it is not solely
> related to pathspecs, but related to pathspecs when used with some other
> commands. hmmm...

I haven't looked into the code, but if my recollection is correct, "add" is a bit curious in that it has to deal with paths that are not yet in the index, unlike "ls-files" and "grep". It could be one half of the code paths use the "grab everything that matches the glob" while the other half uses "stop when there is an exact match", perhaps? In the very early days of Git, I do recall making a very conscious decision to stop when there is an exact match to help those who add funny pathsnames with glob characters in it, but that is a long time ago, so I wouldn't be surprised if we gained multiple code paths to do the same thing, some of which have been corrected while the original ones haven't.

Previous: Lucas Seiki OshiroNext: JAYATHEERTH K
Message 12 of 19 in “add: fix pathspec handling when literal filenames match wildcard”
  1. 0/1 add: fix pathspec handling when literal filenames match wildcardK Jayatheerth, Apr 12, 2025
  2. 1/1 add: fix handling literal filenames and wildcardsK Jayatheerth, Apr 12, 2025
  3. t3706: Add test for wildcard vs literal pathspecK Jayatheerth, Apr 12, 2025
  4. Lucas Seiki OshiroApr 14, 2025
  5. JAYATHEERTH KApr 14, 2025
  6. Junio C HamanoApr 14, 2025
  7. brian m. carlsonApr 15, 2025
  8. JAYATHEERTH KApr 16, 2025
  9. Junio C HamanoApr 16, 2025
  10. JAYATHEERTH KApr 16, 2025
  11. Lucas Seiki OshiroApr 16, 2025
  12. Junio C HamanoApr 16, 2025
  13. JAYATHEERTH KApr 19, 2025
  14. Lucas Seiki OshiroApr 19, 2025
  15. JAYATHEERTH KApr 22, 2025
  16. JAYATHEERTH KApr 16, 2025
  17. JAYATHEERTH KApr 16, 2025
  18. Lucas Seiki OshiroApr 12, 2025
  19. 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.