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

Re: [PATCH] add--interactive: do not expand pathspecs with ls-files

From
Jeff King <peff@peff.net>
Date
Mar 14, 2017, 17:31 UTC
Message-ID
<20170314173150.2triogunl4af4d6z@sigill.intra.peff.net>
In-Reply-To
<20170314172504.GA102212@google.com>
On Tue, Mar 14, 2017 at 10:25:04AM -0700, Brandon Williams wrote:
Show 19 quoted lines
> On 03/14, Jeff King wrote:
> >   b. If the repository contains filenames with literal wildcard
> >      characters (e.g., "foo*"), the original code expanded
> >      them via "ls-files" and then fed those wildcard names
> >      to "diff-index", which would have treated them as
> >      wildcards. This was a bug, which is now fixed (though
> >      unless you really go through some contortions with
> >      ":(literal)", it's likely that your original pathspec
> >      would match whatever the accidentally-expanded wildcard
> >      would anyway).
> > 
> >      So this takes us one step closer to working correctly
> >      with files whose names contain wildcard characters, but
> >      it's likely that others remain (e.g., if "git add -i"
> >      feeds the selected paths to "git add").
> 
> It definitely makes things more difficult when people use wildcard
> characters in filenames.  Is there any reason people use wildcards as
> literal characters in filenames other than them not knowing any better?

The philosophers of the ages have struggled with the question of why users do anything.

I suspect that wildcards in filenames are pretty uncommon, just judging from the lack of complaints. But they do come up. The most recent one was:

  http://public-inbox.org/git/c9876671-6252-5dfa-18df-a6719dc6834c@gmail.com/

It's unclear if that was stimulated by a real-world case, or just mucking around.

-Peff
Previous: Brandon WilliamsNext: Junio C Hamano
Message 4 of 6 in “add--interactive: do not expand pathspecs with ls-files”
  1. add--interactive: do not expand pathspecs with ls-filesJeff King, Mar 14, 2017
  2. Jeff KingMar 14, 2017
  3. Brandon WilliamsMar 14, 2017
  4. Jeff KingMar 14, 2017
  5. Junio C HamanoMar 14, 2017
  6. Jeff KingMar 14, 2017

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.