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

Re: Possible bug or error in document?

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2024, 15:44 UTC
Message-ID
<xmqqh6c58t1t.fsf@gitster.g>
In-Reply-To
<CADLV-7+mQ0K6_-L_Pws9yOYfQ++b4NyH5+FXwbyHuXBiOALeYA@mail.gmail.com>
KwonHyun Kim <kwonhyun.kim@gmail.com> writes:
Show 6 quoted lines
> --ignore-errors
>            If some files could not be added because of errors indexing
> them, do not abort the operation, but continue adding the others. The
> command shall still exit with non-zero
>            status. The configuration variable add.ignoreErrors can be
> set to true to make this the default behaviour.

I think "--ignore-errors" is meant to ignore errors only about "adding" a discovered path (i.e. the exact path that user wants to add) to the index. Perhaps the file exists, but an I/O error prevents Git from reading it fully, causing it to fail computing the blob object name. Such an error is ignored and other paths that got successfully computed their hashes are added to the index.

On the other hand, errors while discovering what exact paths the user wants to add are not ignored. So "git add --ignore-errors -- no-such-file" would still error out in order to notify you that you asked for no-such-file that does not exist, and "--pathspec-from" does not change the story.

What is missing from "git add" might be the "--ignore-unmatch" option that "git rm" has. There are other commands that supports a similarly named "--ignore-missing" option, and we may #leftoverbits want to unify them over time (i.e. decide which one to use in the longer term, say "--ignore-missing", teach "git rm" that "--ignore-missing" is a new synonym for "--ignore-unmatch", add "--ignore-missing" to "git add" and probably other commands that would benefit from having it, and then in a far enough future, retire "--ignore-unmatch" from "git rm").

Previous: KwonHyun Kim
Message 2 of 2 in “Possible bug or error in document?”
  1. KwonHyun KimJul 31, 2024
  2. Junio C HamanoJul 31, 2024

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.