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

Re: suppress fatal pathspec errors from "git add"?

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 3, 2010, 09:44 UTC
Message-ID
<m33a2ncyj2.fsf@localhost.localdomain>
In-Reply-To
<20100103074058.GB23031@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
> On Thu, Dec 31, 2009 at 01:24:59PM -0800, aaron smith wrote:
> 
> > I'm looking through the add documentation, I don't see a way to
> > suppress fatal pathspec errors? For example, if I'm adding 5 files,
> > but one of them is mis-spelled, can I have git just supress the errors
> > and add the other four?
> 
> Hmm. I would have thought "git add --ignore-errors" would do what you
> want, but it only ignores errors in reading the file. If we can't stat
> it, we will always die. IMHO that is an oversight in how
> "--ignore-errors" works (why should this one particular error be treated
> as fatal, when others are not?).

I have thought that this is task for --ignore-missing / --missing-ok option, but this option(s) does not apply to git-add / git-rm; the former is from git-write-index, the latter form from git-write-tree.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Jeff King
Message 6 of 6 in “suppress fatal pathspec errors from "git add"?”
  1. aaron smithDec 31, 2009
  2. Jeff KingJan 3, 2010
  3. aaron smithJan 3, 2010
  4. Junio C HamanoJan 3, 2010
  5. Jeff KingJan 3, 2010
  6. Jakub NarebskiJan 3, 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.