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, 21:01 UTC
Message-ID
<20250909210138.GA1922525@coredump.intra.peff.net>
In-Reply-To
<xmqqsegvtkgm.fsf@gitster.g>
On Tue, Sep 09, 2025 at 01:55:05PM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> Jeff King <peff@peff.net> writes:
> 
> > 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
> 
> The option is described like so:
> 
>     --[no-]ignore-errors  just skip files which cannot be added because of errors
> 
> I think "because of errors" is meant handle a sequence more like this:
> 
>     $ date >foo ; date >bar
>     $ chmod a= foo
>     $ git add --ignore-errors foo bar
>     $ git diff --cached --name-only
>     bar
> 

Yeah, I don't think --ignore-errors is misbehaving, and I read that doc. I just meant that it would not do the thing Jon is asking for. That is more like --ignore-missing.

-Peff
Previous: Junio C HamanoNext: Jeff King
Message 8 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.