Re: [PATCH 3/3] sparse checkout: do not eagerly decide the fate for whole directory
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- May 3, 2011, 04:43 UTC
- Message-ID
- <BANLkTimDO7yRyiBt7xS5Hy7-iT5SUDwJtA@mail.gmail.com>
- In-Reply-To
- <BANLkTikgNR1G5_TO3rmMZy3fN2PNF2Pqjg@mail.gmail.com>
2011/5/3 Thiago Farina <tfransosi@gmail.com>:
Show 23 quoted lines
>> This generally works as long as there are no patterns to exclude parts
>> of the directory. In case of sparse checkout code, the following patterns
>>
>> t
>> !t/t0000-basic.sh
>>
>> will produce a worktree with full directory "t" even if t0000-basic.sh
>> is requested to stay out.
>> ...
>> prefix[prefix_len++] = '/';
>>
>> - /* included, no clearing for any entries under this directory */
>> - if (!ret) {
>> - for (; cache != cache_end; cache++) {
>> - struct cache_entry *ce = *cache;
>> - if (strncmp(ce->name, prefix, prefix_len))
>> - break;
>> - }
>> - return nr - (cache_end - cache);
>> - }
>> + /* If undecided, use parent directory's decision in defval */
> What means "use parent directory's decision"? Could you make this
> comment more clearer?Take the example patterns in commit message, we know that we match directory "t" (pattern 1). When we check t/0001-init.sh, no patterns match it. But because it's under "t", so we consider it matched. On the other hand, t/t0000-basic.sh will match pattern 2 and override parent directory's decision.
Show 5 quoted lines
>> + if (ret < 0) >> + ret = defval; >> >> - /* excluded, clear all selected entries under this directory. */ > Start with capital letter?
It's a line removal, what can I do about it?
-- Duy