Re: [RFC] The design of new pathspec features

2013-01-29 Thread Junio C Hamano
Junio C Hamano writes: > Duy Nguyen writes: > >> On Tue, Jan 29, 2013 at 11:35 AM, Duy Nguyen wrote: >>> :(glob) magic >>> = >>> >>> This magic is for people who want globbing. However, it does _not_ use >>> the same matching mechanism the non-magic pathspec does today. It uses >>>

Re: [RFC] The design of new pathspec features

2013-01-29 Thread Junio C Hamano
Duy Nguyen writes: > On Tue, Jan 29, 2013 at 11:35 AM, Duy Nguyen wrote: >> :(glob) magic >> = >> >> This magic is for people who want globbing. However, it does _not_ use >> the same matching mechanism the non-magic pathspec does today. It uses >> wildmatch(WM_PATHNAME), which basic

Re: [RFC] The design of new pathspec features

2013-01-29 Thread Duy Nguyen
On Tue, Jan 29, 2013 at 11:35 AM, Duy Nguyen wrote: > :(glob) magic > = > > This magic is for people who want globbing. However, it does _not_ use > the same matching mechanism the non-magic pathspec does today. It uses > wildmatch(WM_PATHNAME), which basically means '*' does not match

Re: [RFC] The design of new pathspec features

2013-01-28 Thread Junio C Hamano
Duy Nguyen writes: >> prefixq=$(git rev-parse --show-prefix-glob-quoted) >> pathspec="$prefixq$1" >> >> but magic that applies only to a substring may have other uses. > > Yeah, that simplifies things. Supporting applying magic over just > parts of the pathspec pattern sounds comp

Re: [RFC] The design of new pathspec features

2013-01-28 Thread Duy Nguyen
On Tue, Jan 29, 2013 at 12:33 PM, Junio C Hamano wrote: > Have you considered if it may be helpful to have a :(literal) magic > (or any magic in general) that applies only to the first N > characters of the pathspec pattern? Not user-driven. But the prefix part is :(literal)-applied. :(glob) is c

Re: [RFC] The design of new pathspec features

2013-01-28 Thread Junio C Hamano
Duy Nguyen writes: > :(literal) magic > > > This magic is for people who want simple no-globbing pathspec (*). It > can be used in combination with other magic such as case-insensitive > matching. Incompatible with :(glob) magic below. > > Global option --noglob-pathspecs is adde

Re: [RFC] The design of new pathspec features

2013-01-28 Thread Duy Nguyen
On Tue, Jan 29, 2013 at 12:05 PM, Junio C Hamano wrote: >> New way to specify long pathspec magic >> == >> >> While testing the pathspec magic code, I grow tired of quoting :(glob) >> every time because '(' is the start of a new shell. Which is one of >> the rea

Re: [RFC] The design of new pathspec features

2013-01-28 Thread Junio C Hamano
Duy Nguyen writes: > For those who haven't followed closely, some coming changes allow us > to extend current pathspec syntax. We should soon be able to do > case-insenstive matching for example, or introduce "**" wildcard that > is currently used by gitignore. I just want to discuss about the ne

Re: [RFC] The design of new pathspec features

2013-01-28 Thread Junio C Hamano
Duy Nguyen writes: > Pathspec mnemonic > = > > Are :(literal) and :(glob) used often enough to deserve a short > mnemonic (like :/ is equivalent to :(top))? Which symbols should be > used? I do not think we should discuss this before letting people gain experience with various fo

[RFC] The design of new pathspec features

2013-01-28 Thread Duy Nguyen
For those who haven't followed closely, some coming changes allow us to extend current pathspec syntax. We should soon be able to do case-insenstive matching for example, or introduce "**" wildcard that is currently used by gitignore. I just want to discuss about the new syntax and behavior. Many