Re: [PATCH 01/11] t9902-completion: add tests demonstrating issues with quoted pathnames
From: SZEDER Gábor <hidden>
Date: 2018-04-17 23:41:10
On Wed, Apr 18, 2018 at 1:32 AM, SZEDER Gábor [off-list ref] wrote:
On Tue, Apr 17, 2018 at 5:48 AM, Junio C Hamano [off-list ref] wrote:quoted
SZEDER Gábor [off-list ref] writes:quoted
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.
quoted
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.