Re: [PATCH v3] config: add conditional include

2016-07-13 Thread Duy Nguyen
On Wed, Jul 13, 2016 at 9:21 AM, Matthieu Moy wrote: > Nguyễn Thái Ngọc Duy writes: > >> +`gitdir`:: >> + The environment variable `GIT_DIR` must match the following >> + pattern for files to be included. The pattern can contain >> + standard globbing wildcards and two additional ones

Re: [PATCH v3] config: add conditional include

2016-07-13 Thread Matthieu Moy
Jeff King writes: > On Wed, Jul 13, 2016 at 09:21:37AM +0200, Matthieu Moy wrote: > >> > +static int prepare_include_condition_pattern(struct strbuf *pat) >> > +{ >> > + int prefix = 0; >> > + >> > + /* TODO: maybe support ~user/ too */ >> > + if (pat->buf[0] == '~' && is_dir_sep(pat->buf[1]))

Re: [PATCH v3] config: add conditional include

2016-07-13 Thread Jeff King
On Wed, Jul 13, 2016 at 09:21:37AM +0200, Matthieu Moy wrote: > > +static int prepare_include_condition_pattern(struct strbuf *pat) > > +{ > > + int prefix = 0; > > + > > + /* TODO: maybe support ~user/ too */ > > + if (pat->buf[0] == '~' && is_dir_sep(pat->buf[1])) { > > + struct

Re: [PATCH v3] config: add conditional include

2016-07-13 Thread Matthieu Moy
Nguyễn Thái Ngọc Duy writes: > +`gitdir`:: > + The environment variable `GIT_DIR` must match the following > + pattern for files to be included. The pattern can contain > + standard globbing wildcards and two additional ones, `**/` and > + `/**`, that can match multiple path compo

[PATCH v3] config: add conditional include

2016-07-12 Thread Nguyễn Thái Ngọc Duy
Helped-by: Jeff King Signed-off-by: Nguyễn Thái Ngọc Duy --- v3 fixes some memory leak and typos. Most importantly it no longer depends on core.ignorecase for case-insensitive matching. The choice must be explicitly made by the user when they choose "gitdir" or "gitdir/i" keyword. Documenta