Re: [PATCH 3/2] dir.c: fix dir re-inclusion rules with "NODIR" and "MUSTBEDIR"
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 18, 2016, 06:28 UTC
- Message-ID
- <CACsJy8CrXFUPqJz4kt6fsvFhGDavOfZBQtHD98FuEW14UMmMtg@mail.gmail.com>
- In-Reply-To
- <56EB9E67.1000306@fb.com>
On Fri, Mar 18, 2016 at 1:21 PM, Durham Goode <durham@fb.com> wrote:
Show 14 quoted lines
>> Skipping that tricky pair, the pairs "/*" and "!/dir1/dir2/" means >> "exclude everything except dir1/dir2" (in .gitignore sense) or >> "include everything except dir1/dir2" in sparse checkout sense. Which >> results in empty worktree. 1+2 trips when the trailing slash in the >> last rule exists and includes both files in show/hide. Patch 3/2 fixes >> the tripping and exclude both. If the last rule is "!/dir1/dir2" then >> 1+2 results in empty worktree as well. >> > I'm not sure I fully understand. Here's what I'm seeing, with patch 1, 2, > and 3 applied: with patterns "/*', "!/dir1/dir2", "/dir1/dir2/show", I see > the contents of dir1/dir2/show/ (good). If I add a trailing slash to the > last pattern (so it becomes "/dir1/dir2/show/"), it now results in an empty > working copy. That seems funky, given that the last rule is to include that > directory. Am I misunderstanding the trailing slash?
Ah.. I meant the last slash in !dir1/dir2/, not in dir1/dir2/show. But that's interesting, will need to run some more tests.
> We're pretty far beyond my ability to understand ignore patterns now.
I'm right there with you. I'm starting to fear that I don't (and probably won't) understand this thing.
-- Duy