Re: [PATCH] attr: support quoting pathname patterns in C style
- From
Kevin Ballard <kevin@sb.org>
- Date
- Nov 5, 2010, 21:46 UTC
- Message-ID
- <15C4C111-824D-4657-B034-A1BE1DAD50D4@sb.org>
- In-Reply-To
- <7vvd4bu2pl.fsf@alter.siamese.dyndns.org>
On Nov 5, 2010, at 9:58 AM, Junio C Hamano wrote:
Show 23 quoted lines
> Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes: > >> Full pattern must be quoted. So 'pat"t"ern attr' will give exactly >> 'pat"t"ern', not 'pattern'. Also clarify that leading whitespaces are >> not part of the pattern and document comment syntax. >> >> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> >> --- >> Obvious regression: patterns that begin with double quote will >> now work differently. > > I'm really hesitant to pursue this route and break people's existing > setups, especially if the only benefit this patch tries to achieve is to > allow somebody to say: > > "Program Files/*.txt" ...some attr... > > It is not worth the effort, risk and headache, especially because people > with such paths are probably already using > > Program?Files/*.txt ...some attr.. > > to match them.
Would this actually break any existing setups? The only ones that are affected are ones beginning with ", which I imagine would be rather rare. I personally am in favor of having an unambiguous way to encode whitespace into the pattern. Having to use ? has always struck me as being, well, not very good, especially if you have 2 files that only differ at that character (e.g. file.1 and "file 1").
-Kevin Ballard