Re: [RFC/PATCH] git-add: Don't exclude explicitly-specified tracked files
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 11, 2010, 18:22 UTC
- Message-ID
- <7vmxstypot.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1281510236-8103-1-git-send-email-gdb@mit.edu>
Greg Brockman <gdb@MIT.EDU> writes:
Show 14 quoted lines
> Currently, 'git add' will complain about excluded files, even if they > are already tracked: > > $ mkdir dir && touch dir/file && cat > .gitignore <<< dir > $ git add -f dir/file > $ git status > ... > new file: dir/file > ... > $ git add dir/file > The following paths are ignored by one of your .gitignore files: > dir > Use -f if you really want to add them. > fatal: no files added
Thanks.
I think it is reasonble if we don't complain in this particular case.
What should happen if the user did these instead, after adding "dir" as an ignored entry, and adding dir/file but not dir/untracked to the index?
(1) git add dir/file dir/untracked ; explicitly named (2) git add dir/* ; have shell glob--same as (1) (3) git add "dir/*" ; have git glob (4) git add dir ; have git recurse
What does your code do?