Re: [RFC/PATCH] Add test case for dealing with a tracked file in an ignored directory
From: Matthieu Moy <hidden>
Date: 2016-06-15 22:49:20
Greg Brockman [off-list ref] writes:
quoted
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
quoted
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/