Re: Bug report - sparse-checkout ignores prefix when run in subdirectories
- From
Elijah Newren <newren@gmail.com>
- Date
- Jan 6, 2022, 00:08 UTC
- Message-ID
- <CABPp-BFfuDMQXCZg_5YXQLaPtc9nyrJaq8J6VEDVsaiEMeeZMA@mail.gmail.com>
- In-Reply-To
- <xmqqbl0pg3s7.fsf@gitster.g>
On Wed, Jan 5, 2022 at 3:29 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> > Elijah Newren <newren@gmail.com> writes: > > > So, should "**.py" go directly into the sparse-checkout file as-is, or > > be translated to "my/current/subdir/**.py" first? > > > > Maybe translating is always fine, or maybe we want to throw an error > > when: (not using cone mode and prefix is non-empty and any patterns > > are provided). > > > > Thoughts? > > Perhaps allow things like ":(glob,icase,top)frotz" to be passed and > treating them as pathspec is the most sensible way to go outside the > cone mode? As far as I understand, the cone mode is a strict subset > that is straight-jacketed into "no patterns allowed, just concrete > directory names and nothing else" for simplicity, so it is perfectly > OK for these two to be taking different things.
Are you possibly confusing pathspecs with gitignore patterns here? (Or am I?) Or are you suggesting that sparse-checkout be modified to accept either gitignore-style files or pathspecs and handle both?
I have never liked that gitignore-style patterns were used for sparse-checkout, but it has always seemed a bit too late to change it. Ever since Stolee introduced cone-mode, my preferred strategy for fixing the gitignore-style patterns problem, assuming we are allowed to do so, is to deprecate if not kill non-cone mode. (And in the meantime, I'm just doing due diligence when I mention non-cone mode in my reviews.)