Re: [RFC/PATCH] Add test case for dealing with a tracked file in an ignored directory
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Aug 19, 2010, 08:50 UTC
- Message-ID
- <vpqr5hv56m2.fsf@bauges.imag.fr>
- In-Reply-To
- <AANLkTi=u2jA5MOKwyYO_pwcZaK=A1D2g+gueFGF2L+5U@mail.gmail.com>
Greg Brockman <gdb@mit.edu> writes:
Show 11 quoted lines
>> I don't think you want to complain with "did not match any files" >> here. > Well, I copied the behavior of 'git add "*"' here, where every file in > . is ignored. E.g. > """ > $ echo >ignore-file > $ echo .gitignore >>.gitignore > $ echo ignore-file >>.gitignore > $ git add '*' > fatal: pathspec '*' did not match any files > """
OK, that makes sense (you can add comments to your tests or commit message to justify this is case someone wonders later).
> realized today that git globbing seems to act differently depending on > where the wildcard appears. E.g.:
> Is this a bug?
There are many known inconsistancies with Git globing, yes. See for example:
http://thread.gmane.org/gmane.comp.version-control.git/128672/focus=128759
Show 15 quoted lines
>> You're not testing the case >> >> git add ignored-dir/ >> >> which gives another case where Git tries to add files not explicitely >> given on the command-line. But the correct behavior of this case may >> be more controversial, so maybe it's indeed better to focus on the >> other cases. > A fair point. I would have thought the behavior here should be > unchanged, namely that 'git add ignored-dir/' should spit out a "The > following paths are ignored by one of your .gitignore files: ..." > error, regardless of the directory's contents. Does anyone believe > this should be different/would it be useful for me to draw up a test > case for it now? In any case, I'll certainly put a test case for this > into the final patch.
It makes sense to make "git add dir/" equivalent to "git add dir/*", but I don't really care either way.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/