git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Possible regression for sparse-checkout in git 2.27.0

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 5, 2020, 13:07 UTC
Message-ID
<7a6e14b2-84ce-0a78-3644-ffd0e647df05@gmail.com>
In-Reply-To
<xmqqtuzqnxdm.fsf@gitster.c.googlers.com>
On 6/4/2020 8:56 PM, Junio C Hamano wrote:
Show 16 quoted lines
> Derrick Stolee <stolee@gmail.com> writes:
> 
>> The first is due to the .gitignore syntax. The syntax allows exact
>> matches for _directories_ using a trailing slash "/". For example,
>> we can match everything in A/B/C with the pattern
>>
>> 	A/B/C/
>>
>> This would match the files in A/B/C/ and its subdirectories, but will
>> not match a file A/B/C.txt or A/B/C1/. There is no equivalent matching
>> for files, so A/B/C _will_ match a file A/B/C and A/B/C.txt. Whether this
>> matters to you or not depends on your file structure.
> 
> The pattern A/B/C _will_ match a file A/B/C and a directory A/B/C/,
> but I do not think it matches a file A/B/C.txt (or a path with any
> other suffix).

You are correct! I am mistaken. The directory/file confusion would lead to some interesting logic in an implementation that allowed file matches.

> I suspect that for the purpose of your explanation, the pattern
> A/B/C does not have to match A/B/C.txt to cause trouble; the fact
> that it matches directory A/B/C would be sufficient, I guess.
Yes. It certainly complicates things.

The thing I neglected to mention is that this file-based matching is usually necessary when there is a directory containing _all_ of the "big files" instead of organizing those files into directories based on who needs those files. It is possible to reorganize the directory structure to use cone mode and achieve similar goals.

Thanks, -Stolee

Previous: Junio C Hamano
Message 8 of 8 in “Possible regression for sparse-checkout in git 2.27.0”
  1. Shaun CaseJun 3, 2020
  2. Elijah NewrenJun 3, 2020
  3. Derrick StoleeJun 3, 2020
  4. Elijah NewrenJun 4, 2020
  5. Shaun CaseJun 4, 2020
  6. Derrick StoleeJun 5, 2020
  7. Junio C HamanoJun 5, 2020
  8. Derrick StoleeJun 5, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.