RE: 2.8.0 gitignore enhancement not working as expected

2016-03-19 Thread Richard Furness -X (rfurness - ENSOFT LIMITED at Cisco)
iginal Message-
> From: Duy Nguyen [mailto:pclo...@gmail.com]
> Sent: 18 March 2016 11:19
> To: Richard Furness -X (rfurness - ENSOFT LIMITED at Cisco)
> <rfurn...@cisco.com>
> Cc: git@vger.kernel.org
> Subject: Re: 2.8.0 gitignore enhancement not working as expected
> 
> On Fri, Mar 18, 2016 at 4:31 PM, Richard Furness -X (rfurness - ENSOFT
> LIMITED at Cisco) <rfurn...@cisco.com> wrote:
> > Hi,
> >
> > I've been testing out git 2.8.0 rc3 due to having a particular interest in 
> > this
> enhancement from the changelog:
> > " Another try to improve the ignore mechanism that lets you say "this
> >is excluded" and then later say "oh, no, this part (that is a
> >subset of the previous part) is not excluded".  This has still a
> >known limitation, though."
> >
> > Currently, in order to include ONLY the files under a/b/c I have the
> following in .gitignore:
> > /* - Ignore everything
> > !/a - Except directory "a"
> > /a/*- Ignore all sub-directories of "a/"
> > !/a/b   - Except "a/b"
> > /a/b/*  - Ignore all sub-directories of "a/b/"
> > !/a/b/c - Except "a/b/c"
> >
> > My hope was that with this enhancement I could massively simplify this to:
> > /* - Ignore everything
> > !a/b/c  - Except "a/b/c"
> >
> > However this doesn't seem to work - instead I find that NOTHING is
> ignored (i.e. it's as if the 2nd line completely cancels the first).
> 
> Interesting. It seems to be working for me. This is my test setup
> 
> > /tmp/abc $ find * -type f
> 1
> a/1
> a/b/1
> a/b/c
> > /tmp/abc $ cat .gitignore
> /*
> !a/b/c
> 
> and the results
> 
> > /tmp/abc $ ~/w/git/temp/git --version
> git version 2.8.0.rc3
> > /tmp/abc $ ~/w/git/temp/git ls-files -o --exclude-standard
> a/b/c
> 
> Can you do "GIT_TRACE_EXCLUDE=1 git ls-files -o --exclude-standard"
> and post the output?
> --
> Duy


Re: 2.8.0 gitignore enhancement not working as expected

2016-03-19 Thread Duy Nguyen
On Fri, Mar 18, 2016 at 9:32 PM, Richard Furness -X (rfurness - ENSOFT
LIMITED at Cisco)  wrote:
> Hi Duy,
>
> I tried your exact example and it worked correctly. But then I tried adding 
> some more files/dirs at the top level and I still see an issue:

Thank you. Phew.. I bet you hit the same bug we found yesterday (your
trace suggests so). Can you try this patch [1] just to confirm?

[1] http://article.gmane.org/gmane.comp.version-control.git/289101
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: 2.8.0 gitignore enhancement not working as expected

2016-03-19 Thread Duy Nguyen
On Fri, Mar 18, 2016 at 4:31 PM, Richard Furness -X (rfurness - ENSOFT
LIMITED at Cisco)  wrote:
> Hi,
>
> I've been testing out git 2.8.0 rc3 due to having a particular interest in 
> this enhancement from the changelog:
> " Another try to improve the ignore mechanism that lets you say "this
>is excluded" and then later say "oh, no, this part (that is a
>subset of the previous part) is not excluded".  This has still a
>known limitation, though."
>
> Currently, in order to include ONLY the files under a/b/c I have the 
> following in .gitignore:
> /* - Ignore everything
> !/a - Except directory "a"
> /a/*- Ignore all sub-directories of "a/"
> !/a/b   - Except "a/b"
> /a/b/*  - Ignore all sub-directories of "a/b/"
> !/a/b/c - Except "a/b/c"
>
> My hope was that with this enhancement I could massively simplify this to:
> /* - Ignore everything
> !a/b/c  - Except "a/b/c"
>
> However this doesn't seem to work - instead I find that NOTHING is ignored 
> (i.e. it's as if the 2nd line completely cancels the first).

Interesting. It seems to be working for me. This is my test setup

> /tmp/abc $ find * -type f
1
a/1
a/b/1
a/b/c
> /tmp/abc $ cat .gitignore
/*
!a/b/c

and the results

> /tmp/abc $ ~/w/git/temp/git --version
git version 2.8.0.rc3
> /tmp/abc $ ~/w/git/temp/git ls-files -o --exclude-standard
a/b/c

Can you do "GIT_TRACE_EXCLUDE=1 git ls-files -o --exclude-standard"
and post the output?
-- 
Duy
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: 2.8.0 gitignore enhancement not working as expected

2016-03-18 Thread Richard Furness -X (rfurness - ENSOFT LIMITED at Cisco)
Hi Duy,

That seems to have fixed it :-)

Thanks for your help!

Richard

> -Original Message-
> From: Duy Nguyen [mailto:pclo...@gmail.com]
> Sent: 18 March 2016 14:53
> To: Richard Furness -X (rfurness - ENSOFT LIMITED at Cisco)
> <rfurn...@cisco.com>
> Cc: git@vger.kernel.org
> Subject: Re: 2.8.0 gitignore enhancement not working as expected
> 
> On Fri, Mar 18, 2016 at 9:32 PM, Richard Furness -X (rfurness - ENSOFT
> LIMITED at Cisco) <rfurn...@cisco.com> wrote:
> > Hi Duy,
> >
> > I tried your exact example and it worked correctly. But then I tried adding
> some more files/dirs at the top level and I still see an issue:
> 
> Thank you. Phew.. I bet you hit the same bug we found yesterday (your
> trace suggests so). Can you try this patch [1] just to confirm?
> 
> [1] http://article.gmane.org/gmane.comp.version-control.git/289101
> --
> Duy
N�r��yb�X��ǧv�^�)޺{.n�+ا���ܨ}���Ơz�:+v���zZ+��+zf���h���~i���z��w���?�&�)ߢf