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

Re: Is Git Add Supposed to Work Like This (git 2.50)?

From
Jeff King <peff@peff.net>
Date
Sep 9, 2025, 18:42 UTC
Message-ID
<20250909184231.GB1912898@coredump.intra.peff.net>
In-Reply-To
<109prte$j8b$1@ciao.gmane.io>
On Tue, Sep 09, 2025 at 11:33:18AM -0700, Jon Forrest wrote:
Show 12 quoted lines
> On 9/9/25 9:00 AM, Jon Forrest wrote:
> > 
> > 
> > If this were a big deal, which it isn't, I'd suggest a command line
> > flag that says what to do if there's an invalid file specified on
> > the command line. One setting of the flag would result in the
> > current behavior and the other setting would result in all the
> > invalid file(s) being ignored and the valid file(s) being
> > handled normally.
> 
> Nevermind. I should have checked the man page.
> The '--ignore-errors' option already does this.

Oops, I think our mails just crossed. I don't think --ignore-errors does quite what you want, though:

  $ touch foo
  $ git add foo bar
  fatal: pathspec 'bar' did not match any files
  $ git add --ignore-errors foo bar
  fatal: pathspec 'bar' did not match any files
  $ git status --porcelain
  ?? foo
-Peff
Previous: Jon ForrestNext: Junio C Hamano
Message 6 of 9 in “Is Git Add Supposed to Work Like This (git 2.50)?”
  1. Jon ForrestSep 7, 2025
  2. Re Is Git Add Supposed to Work Like This (git 2.50)?K Jayatheerth, Sep 7, 2025
  3. Jeff KingSep 7, 2025
  4. Jon ForrestSep 9, 2025
  5. Jon ForrestSep 9, 2025
  6. Jeff KingSep 9, 2025
  7. Junio C HamanoSep 9, 2025
  8. Jeff KingSep 9, 2025
  9. Jeff KingSep 9, 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.