Re: [PATCH] config: add conditional include

2016-06-27 Thread Jeff King
On Mon, Jun 27, 2016 at 06:32:39PM +0200, Duy Nguyen wrote: > On Mon, Jun 27, 2016 at 6:20 PM, Jeff King wrote: > > You do allow distinguishing the suffix thing with "/" at the end in the > > rule above, though. So between the two rules: > > > > - slash at the end is a shorthand for "/**" > > >

Re: [PATCH] config: add conditional include

2016-06-27 Thread Duy Nguyen
On Mon, Jun 27, 2016 at 6:20 PM, Jeff King wrote: > You do allow distinguishing the suffix thing with "/" at the end in the > rule above, though. So between the two rules: > > - slash at the end is a shorthand for "/**" > > - no-slash at the beginning (i.e., a non-absolute path) is a shorthand

Re: [PATCH] config: add conditional include

2016-06-27 Thread Duy Nguyen
On Sun, Jun 26, 2016 at 8:27 PM, Jeff King wrote: > On Sun, Jun 26, 2016 at 09:06:17AM +0200, Nguyễn Thái Ngọc Duy wrote: > >> If the path argument in "include" starts with "gitdir:", it is >> followed by a wildmatch pattern. The include is only effective if >> $GIT_DIR matches the pattern. This i

Re: [PATCH] config: add conditional include

2016-06-27 Thread Jeff King
On Mon, Jun 27, 2016 at 06:14:17PM +0200, Duy Nguyen wrote: > >> + } else if (!strchr(pattern.buf, '/')) { > >> + /* no slashes match one directory component */ > >> + strbuf_insert(&pattern, 0, "**/", 3); > >> + strbuf_addstr

Re: [PATCH] config: add conditional include

2016-06-26 Thread Jeff King
On Sun, Jun 26, 2016 at 09:06:17AM +0200, Nguyễn Thái Ngọc Duy wrote: > If the path argument in "include" starts with "gitdir:", it is > followed by a wildmatch pattern. The include is only effective if > $GIT_DIR matches the pattern. This is very useful to add configuration > to a group of reposi

[PATCH] config: add conditional include

2016-06-26 Thread Nguyễn Thái Ngọc Duy
If the path argument in "include" starts with "gitdir:", it is followed by a wildmatch pattern. The include is only effective if $GIT_DIR matches the pattern. This is very useful to add configuration to a group of repositories. For convenience - "~" is expanded to $USER - if the pattern ends w