Re: [PATCH 2/5] fix "git add --ignore-errors" to ignore pathspec errors
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 13, 2009, 19:38 UTC
- Message-ID
- <7vr5vfa4ha.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1250133624-2272-2-git-send-email-luke-jr+git@utopios.org>
Luke Dashjr <luke-jr+git@utopios.org> writes:
> Unmatched files are errors, and should be ignored with the rest of them.
Why is this a "fix"?
I would understand if it were "Make --ignore-errors imply --ignore-unmatch unconditionally". But then I do not think I would necessarily agree it is a good change.
The user may know that some files in the work tree are unreadable and cannot be indexed (hence he gives --ignore-errors) but he still may want to catch a typo on the command line.
I do not think it is wise to make --ignore-errors imply --ignore-unmatch unconditionally like this patch does without any escape hatch.
Show 20 quoted lines
> Signed-off-by: Luke Dashjr <luke-jr+git@utopios.org> > --- > builtin-add.c | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/builtin-add.c b/builtin-add.c > index 0597fb9..e3132c8 100644 > --- a/builtin-add.c > +++ b/builtin-add.c > @@ -280,6 +280,8 @@ int cmd_add(int argc, const char **argv, const char *prefix) > add_interactive = 1; > if (add_interactive) > exit(interactive_add(argc - 1, argv + 1, prefix)); > + if (ignore_add_errors) > + ignore_unmatch = 1; > > if (edit_interactive) > return(edit_patch(argc, argv, prefix)); > -- > 1.6.3.3