threads / discuss / 33972

git ignore regression in 1.8.3

Subject: git ignore regression in 1.8.3

## tl;dr

4 messages between May 29, 2013 and May 29, 2013.

replies: 3people: 3as markdown or json

Nicolas Desprès· May 29, 2013, 12:31 UTC · lore
Hi all,

First of all I would like to thank you all for the great tool that is git. I love it and it makes my days way better. This is my first post on this mailing list so please apology if there is something wrong.

I have noticed a regression in the behavior of ignore rules in 1.8.3. I have read the release notes and it might be related to all the great optimization you guys have done. My use case is quite uncommon but may happens to people who are tracking their "dot files" like I do. Basically I have a whitelist of non-ignored files at the top of my repository and a blacklist of ignored file in some of the direct sub-directories.

Example: $ cd /tmp $ mkdir repo $ cd repo $ git init $ mkdir d $ touch tracked d/tracked $ git add tracked d/tracked $ git commit -m "Initial commit" $ touch untracked d/untracked $ touch ignored d/ignored $ echo '/*' >> .gitignore $ echo '!/d/' >> .gitignore $ echo '!/*' >> d/.gitignore $ echo 'ignored' >> d/.gitignore $ cat .gitignore /* !/d/ $ cat d/.gitignore !/* ignored $ git --version git version 1.8.3 $ git status -sb ## master ?? d/.gitignore ?? d/ignored ?? d/untracked $ /usr/local/Cellar/git/1.8.2.3/bin/git --version git version 1.8.2.3 $ /usr/local/Cellar/git/1.8.2.3/bin/git status -sb ## master ?? d/.gitignore ?? d/untracked $ git config status.showUntrackedFiles $ git check-ignore -v d/ignored .gitignore:2:!/d/ d/ignored $ /usr/local/Cellar/git/1.8.2.3/bin/git check-ignore -v d/ignored .gitignore:2:!/d/ d/ignored

Although I am confused by the fact that both version of check-ignore print the same result, my understanding of this behavior is that the "local" d/.gitignore file is not taken into account and that once a negate rule is set I can not include other sub-pattern any longer. I have tried to only use the root .gitignore file like this

/* !/d/ /d/ignored

but I have the same result. Removing the trailing slash in the negative pattern (like this !/d) does not change anything. If I use !/d/*, both version of git-status no longer report d/untracked.

I was happy with the 1.8.2.3 behavior. Maybe I misunderstand the new behavior of 1.8.3. If yes please tell me how I could achieve the same tricks in 1.8.3 because I did not find out how. I have the same result with the next branch (version 1.8.3.430.gc6abf3f).

I have never hacked into git code base but I am willing to help if someone can guide me a bit.

Regards,

-- Nicolas Desprès

Duy Nguyen· May 29, 2013, 13:31 UTC · re: Nicolas Desprès · lore

Re: git ignore regression in 1.8.3

On Wed, May 29, 2013 at 7:31 PM, Nicolas Desprès <nicolas.despres@gmail.com> wrote:

> I have noticed a regression in the behavior of ignore rules in 1.8.3.

Yeah, it looks like everybody suddenly realizes this regression soon after the release, not before :( This has been reported three times so far. You may want to check the discussion (and hopefully progress soon) in this thread:

http://thread.gmane.org/gmane.comp.version-control.git/225675/focus=225713

We really need to add some real world use cases of gitignore in the test suite. -- Duy

Felipe Contreras· May 29, 2013, 13:43 UTC · re: Duy Nguyen · lore

Re: git ignore regression in 1.8.3

On Wed, May 29, 2013 at 8:31 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 6 quoted lines
> On Wed, May 29, 2013 at 7:31 PM, Nicolas Desprès
> <nicolas.despres@gmail.com> wrote:
>> I have noticed a regression in the behavior of ignore rules in 1.8.3.
>
> Yeah, it looks like everybody suddenly realizes this regression soon
> after the release, not before :(

That's because the vast majority of users only use the releases (maybe more than 90%?). It's not a big deal, that's what 1.8.3.1 is for :) (also, that's why we shouldn't worry to death about imaginary users, our real users will gladly point out when we have screwed up).

-- 
Felipe Contreras
Nicolas Desprès· May 29, 2013, 13:54 UTC · re: Duy Nguyen · lore

Re: git ignore regression in 1.8.3

On Wed, May 29, 2013 at 3:31 PM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 11 quoted lines
> On Wed, May 29, 2013 at 7:31 PM, Nicolas Desprès
> <nicolas.despres@gmail.com> wrote:
>> I have noticed a regression in the behavior of ignore rules in 1.8.3.
>
> Yeah, it looks like everybody suddenly realizes this regression soon
> after the release, not before :( This has been reported three times so
> far. You may want to check the discussion (and hopefully progress
> soon) in this thread:
>
> http://thread.gmane.org/gmane.comp.version-control.git/225675/focus=225713
>

Oups! I'm sorry I searched the archives but did not find this one. Thanks for your reply and the link

> We really need to add some real world use cases of gitignore in the test suite.
There is kind of one included in to my post (minus the assert statements).

-- Nicolas Desprès

← back to recent threads