On 1/29/2020 8:58 AM, Derrick Stolee wrote: > On 1/29/2020 5:03 AM, Jeff King wrote: >> On Tue, Jan 28, 2020 at 06:26:40PM +0000, Derrick Stolee via GitGitGadget wrote: >> >>> From: Derrick Stolee <dstolee@xxxxxxxxxxxxx> >>> >>> In cone mode, the sparse-checkout feature uses hashset containment >>> queries to match paths. Make this algorithm respect escaped asterisk >>> (*) and backslash (\) characters. >> >> Do we also need to worry about other glob metacharacters? E.g., "?" or >> ranges like "[A-Z]"? > > These are not part of the .gitignore patterns [1]. > > [1] https://git-scm.com/docs/gitignore#_pattern_format I should read things more carefully. There is also this information in one of the bullets: An asterisk "*" matches anything except a slash. The character "?" matches any one character except "/". The range notation, e.g. [a-zA-Z], can be used to match one of the characters in a range. See fnmatch(3) and the FNM_PATHNAME flag for a more detailed description. So this series does not attempt to properly work with globs, and I'll need to test those a bit. Certainly they shouldn't work in cone mode, so an extra patch to remove those would be simple. Input sanitizing would be interesting, and I'll see what `git ls-tree` would output with paths containing these characters. -Stolee