* Possible bug or error in document?
@ 2024-07-31 6:08 KwonHyun Kim
2024-07-31 15:44 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: KwonHyun Kim @ 2024-07-31 6:08 UTC (permalink / raw)
To: git
Hello there, I have a possible bug or possible error in document.
When I do `git add --pathspec-from=.gitadd --ignore-errors` I can
the following error
```
$ git add --pathspec-from=.gitadd --ignore-errors
fatal: pathspec 'chapter???.R' did not match any files
```
I figured from what I read from the help, --ignore-errors means add
whatever possible(help included in the following)
--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.
So is it me possibly misunderstanding English, or it might be git
doing something wrong or document directing someone in the wrong
direction...
I thought I might use this option(--pathsepc-from=) like using
.gitignore in the opposite way but it seems that I need to make my own
script to read line by line and do `git add`
Thank you for reading.
KwH Kim
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: Possible bug or error in document?
2024-07-31 6:08 Possible bug or error in document? KwonHyun Kim
@ 2024-07-31 15:44 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2024-07-31 15:44 UTC (permalink / raw)
To: KwonHyun Kim; +Cc: git
KwonHyun Kim <kwonhyun.kim@gmail.com> writes:
> --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").
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-31 15:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-31 6:08 Possible bug or error in document? KwonHyun Kim
2024-07-31 15:44 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.