Re: [PATCH 3/2] dir.c: fix dir re-inclusion rules with "NODIR" and "MUSTBEDIR"
- From
- Durham Goode <durham@fb.com>
- Date
- Mar 18, 2016, 04:51 UTC
- Message-ID
- <56EB8961.70302@fb.com>
- In-Reply-To
- <xmqqfuvoy89q.fsf@gitster.mtv.corp.google.com>
On 3/17/16 4:49 PM, Junio C Hamano wrote:
Show 14 quoted lines
> Thanks for these 5 patches, two of which need to be discarded ;-). > I think you can pick either one of 1/2, pick the one that says > "non-NULL" (as opposed to "something") in the log message for 2/2. > > Durham, does it fix your issues if you apply the 1/2 and 2/2 (but > not 3/2) on top of 2.8-rc? > > Duy, how comfortable are you with the idea of including this two in > 2.8 final? We have long passed the final -rc, and while it is > probably OK to prolong the cycle and do another -rc, we cannot keep > going like "oops, there is another thing discovered by somebod new" > forever. > > Thanks.
Patches 1+2 fix the repro steps in the report, yes. But I've found another case that produces different results in 2.8 than in 2.7:
Given a repo with files:
dir1/dir2/show/file dir1/dir2/hide/file
and a sparse-checkout of
/* /dir1/dir2/show !/dir1/dir2/
the working copy still contains dir1/dir2/hide/file when run from 2.8.0-rc2. In git 2.6 and 2.7.3 it does not show up (which is the expected behavior, from what I understand of the docs). Repro script is below. Notice, the 'dir2/' part of the paths is important. If I drop that directory, the issue doesn't repro.
#!/bin/bash
set -x rm -rf sparse-test GIT=git $GIT init sparse-test cd sparse-test $GIT config --add core.sparsecheckout true
mkdir -p dir1/dir2/show dir1/dir2/hide touch dir1/dir2/show/file1 touch dir1/dir2/hide/file2
$GIT add . $GIT commit -m "initial commit" $GIT read-tree --reset -u HEAD
mkdir .git/info cat > .git/info/sparse-checkout <<EOF /* /dir1/dir2/show !/dir1/dir2/ EOF $GIT read-tree --reset -u HEAD
ls -R dir1/dir2 set +x echo echo expected: see only "dir1/dir2/show/file" echo actual: see "dir1/dir2/hide/file" as well