From: Nguyen Thai Ngoc Duy Date: Sun, 08 May 2011 09:59:57 GMT Subject: Re: [PATCH] t3703: add test cases for pathspec magic Message-ID: In-Reply-To: <7vwri2wd8x.fsf@alter.siamese.dyndns.org> 2011/5/8 Junio C Hamano : > Nguyễn Thái Ngọc Duy   writes: > >> That was the intention, but it raises a question: what do we do if a >> file happens to have the same name with the given magic pathspec, as >> in the last two tests? > > I would have expected that in such a case the user would pass a "\:" or > even ":::" to match the file ":", and "\:(rubbish)" to match the file > ":(rubbish)".  The whole ":" is special thing comes from the observation > that a path that begins with a colon is rare, so it is Ok to require the > user to do some more work (typing an extra backslash) when he really wants > to match with such a thing. > > A script that takes a pathname that is meant to be a literal from the user > in its variable $x would pass ":(noglob)$x" when it wants to be strict.  A > script that lets the user say whatever and wants to pass would just pass > "$x" along the callchain. > > I do not expect this to be an issue in practice, though.  Have you seen a > script that tries to quote all the possible globbing characters in "$x" > before calling into git with the current codebase without this magic? Point taken. -- Duy