Re: [PATCH 01/11] t9902-completion: add tests demonstrating issues with quoted pathnames
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Apr 17, 2018, 23:41 UTC
- Message-ID
- <CAM0VKj=LGON7C-kb6uPykqiX-wLeZsoYpt+-4ktfQ6Fvb_C7Rw@mail.gmail.com>
- In-Reply-To
- <CAM0VKjk=JtdoduywJ4t5OPhLGgt90yxJA_Zif6R803XHA=Sfbg@mail.gmail.com>
On Wed, Apr 18, 2018 at 1:32 AM, SZEDER Gábor <szeder.dev@gmail.com> wrote:
Show 9 quoted lines
> On Tue, Apr 17, 2018 at 5:48 AM, Junio C Hamano <gitster@pobox.com> wrote: >> SZEDER Gábor <szeder.dev@gmail.com> writes: >> >>> Do any more new tests need FUNNYNAMES* prereq? >> >> Hmph, all of these look like they involve some funnynames ;-) > > Well, I can' create a directory with a '|' in its name on FAT32 (on > Linux), so this needs FUNNYNAMES prereq, too.
Or, on second thought, using a different, more widely usable character would be better, so the test can be run on more platforms.
Show 17 quoted lines
>> Do we want to test a more common case of a filename that is two >> words with SP in between, i.e. >> >> $ >'hello world' && git add hel<TAB> >> >> or is it known to work just fine without quoting/escaping (because >> the funny we care about is output from ls-files and SP is not special >> in its one-item-at-a-time-on-a-line output) and not worth checking? > > This particular case already works, even without this patch series. > > The problems start when you want to complete the filename after a space, > e.g. 'hello\ w<TAB', as discussed in detail in patch 5. Actually, this > was the first thing I tried to write a test for, but it didn't work out: > inside the 'test_completion' helper function the space acts as > separator, and the completion script then sees 'hello\' and 'w' as two > separate words.
On another second thought, a test for the already working 'hel<TAB>' case could make sure that we won't mess up the value of IFS when filling COMPREPLY.