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

Re: Gitignore matching "git add" wildcard prevents operation

From
Jeff King <peff@peff.net>
Date
Jan 15, 2010, 16:30 UTC
Message-ID
<20100115163021.GA1947@coredump.intra.peff.net>
In-Reply-To
<20100115161107.GC12982@vidovic>
On Fri, Jan 15, 2010 at 05:11:07PM +0100, Nicolas Sebrecht wrote:
Show 5 quoted lines
> > I don't understand what you mean. How does "sed" do its own globbing of
> > the command line?
> 
> Well, we are in the same dilemma as the other tools. The internal
> globbing rules are explained in the related man page.

Maybe I wasn't clear: to my knowledge, "sed" does not do any globbing itself. How is this the same situation?

Of course other commands like sed will be fed the expansion of a shell glob, and there may be times when you want to feed a subset of an expansion. But that is not my complaint; my complaint was mainly that git's solution to this is not easily discoverable by an uninformed user. Most other commands don't even have a solution (you would have to solve it in the shell to pass the desired expansion to the program).

Show 5 quoted lines
> > when I look in the manual, I am more likely to look for a command-line
> > option that helps me rather than to read all of the text
> 
> True. All I can see is to improve the man page with a dedicated section
> "Globbing" instead of loosing it in a "random" place.

I don't think that would help. The problem is that the user knows they have an issue with ignored files. The solution is custom globbing, but they don't know that. So making globbing more prominent doesn't help, since they will be looking for ignores. You would need to have an "ignore" section that mentions globbing.

To be clear: I do not have an actual solution, and my initial message was mostly just grumbling. We _do_ mention globbing and ignores in the same paragraph, as I quoted earlier. So that is probably enough for a diligent user to come up with the solution, or at least enough that trying to improve on it will have diminishing returns.

You could even argue that I was not being such a diligent user in my initial response. :)

-Peff
Previous: Nicolas SebrechtNext: Nicolas Sebrecht
Message 8 of 12 in “Gitignore matching "git add" wildcard prevents operation”
  1. Marko PoutiainenJan 14, 2010
  2. Jeff KingJan 14, 2010
  3. Junio C HamanoJan 14, 2010
  4. Jeff KingJan 14, 2010
  5. Nicolas SebrechtJan 15, 2010
  6. Jeff KingJan 15, 2010
  7. Nicolas SebrechtJan 15, 2010
  8. Jeff KingJan 15, 2010
  9. Nicolas SebrechtJan 15, 2010
  10. Junio C HamanoJan 15, 2010
  11. Marko PoutiainenJan 14, 2010
  12. Nicolas SebrechtJan 15, 2010

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.