Subject: Re: bug: sparse config interpretation incorrectness in 2.8.0-rc2

From: Durham Goode <[email-masked]>
Date: Wed, 16 Mar 2016 23:49:28 -0700

On 3/16/16 5:56 PM, Duy Nguyen wrote:
> On Wed, Mar 16, 2016 at 05:09:23PM -0700, Durham Goode wrote:
>> Using git 2.8.0-rc2, given a repo with the following files:
>>
>> - one/hideme
>> - one/donthide
>> - two/foo
>>
>> A sparse config of:
>>
>> cat > .git/info/sparse-checkout <<EOF
>> /*
>> !one/hideme
>> EOF
>>
>> Results in a repository that only has `one/donthide` in it.  I would
>> expect `two/foo`to be present as well.  This worked in 2.6, and
>> bisecting it points to d589a67eceacd1cc171bbe94906ca7c9a0edd8c5
>> "dir.c: don't exclude whole dir prematurely" (author cc'd).
> Thank you. This should fix it. I think I understand why it goes
> wrong. I'm going to run some more tests and post a proper patch later.
>
> -- 8< --
> diff --git a/dir.c b/dir.c
> index 69e0be6..77f38a5 100644
> --- a/dir.c
> +++ b/dir.c
> @@ -1027,7 +1027,6 @@ static struct exclude *last_exclude_matching_from_list(const char *pathname,
>   				exc = x;
>   				break;
>   			}
> -			continue;
>   		}
>   
>   		if (x->flags & EXC_FLAG_MUSTBEDIR) {
> -- 8< --
> --
> Duy
To provide some perspective on the severity of this bug: all of our 
users who were using sparse checkouts had their working copy mostly 
deleted when they did a checkout after we upgraded to 2.8.0-rc2.  So I'd 
think this is a fix that should get in to 2.8.