Re: [PATCH v3 5/5] sparse-checkout: reject arguments in cone-mode that look like patterns
- From
Elijah Newren <newren@gmail.com>
- Date
- Feb 17, 2022, 02:26 UTC
- Message-ID
- <CABPp-BGcX=Ajj2p=KRp9KxJheAwrAZVzd9JqN0gqzhujobScTA@mail.gmail.com>
- In-Reply-To
- <CABPp-BEBX4tWwqkG=7+rcZa_EJzOC2+Rg214av_+-yymHTQGQw@mail.gmail.com>
I misspoke...
On Wed, Feb 16, 2022 at 8:54 AM Elijah Newren <newren@gmail.com> wrote:
Show 28 quoted lines
> > On Wed, Feb 16, 2022 at 1:57 AM Ævar Arnfjörð Bjarmason > <avarab@gmail.com> wrote: > > > > On Wed, Feb 16 2022, Elijah Newren via GitGitGadget wrote: > > > > > From: Elijah Newren <newren@gmail.com> > > > > > > In sparse-checkout add/set under cone mode, the arguments passed are > > > supposed to be directories rather than gitignore-style patterns. > > > However, given the amount of effort spent in the manual discussing > > > patterns, it is easy for users to assume they need to pass patterns such > > > as > > > /foo/* > > > or > > > !/bar/*/ > > > or perhaps they really do ignore the directory rule and specify a > > > random gitignore-style pattern like > > > *.c > > > > > > To help catch such mistakes, throw an error if any of the positional > > > arguments: > > > * starts with any of '/!' > > > * contains any of '*\?[]' > > > > But not "\" itself, we're just escaping the "?" here?... > > Nah, I just missed that one. I should add it below.
I should not have included '\' in the commit message; the code was correct. The code treats backslashes specially on Windows (see t1091.46 -- 'cone mode replaces backslashes with slashes'), and I'd rather avoid having platform-specific error messages/checks, so I left backslashes out. But I do need to fix up the commit message to match the code.