All of lore.kernel.org
 help / color / mirror / Atom feed
* git ignore regression in 1.8.3
@ 2013-05-29 12:31 Nicolas Desprès
  2013-05-29 13:31 ` Duy Nguyen
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Desprès @ 2013-05-29 12:31 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git ignore regression in 1.8.3
  2013-05-29 12:31 git ignore regression in 1.8.3 Nicolas Desprès
@ 2013-05-29 13:31 ` Duy Nguyen
  2013-05-29 13:43   ` Felipe Contreras
  2013-05-29 13:54   ` Nicolas Desprès
  0 siblings, 2 replies; 4+ messages in thread
From: Duy Nguyen @ 2013-05-29 13:31 UTC (permalink / raw)
  To: Nicolas Desprès; +Cc: git

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git ignore regression in 1.8.3
  2013-05-29 13:31 ` Duy Nguyen
@ 2013-05-29 13:43   ` Felipe Contreras
  2013-05-29 13:54   ` Nicolas Desprès
  1 sibling, 0 replies; 4+ messages in thread
From: Felipe Contreras @ 2013-05-29 13:43 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: Nicolas Desprès, git

On Wed, May 29, 2013 at 8:31 AM, Duy Nguyen <pclouds@gmail.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: git ignore regression in 1.8.3
  2013-05-29 13:31 ` Duy Nguyen
  2013-05-29 13:43   ` Felipe Contreras
@ 2013-05-29 13:54   ` Nicolas Desprès
  1 sibling, 0 replies; 4+ messages in thread
From: Nicolas Desprès @ 2013-05-29 13:54 UTC (permalink / raw)
  To: Duy Nguyen; +Cc: git

On Wed, May 29, 2013 at 3:31 PM, Duy Nguyen <pclouds@gmail.com> wrote:
> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-29 13:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-29 12:31 git ignore regression in 1.8.3 Nicolas Desprès
2013-05-29 13:31 ` Duy Nguyen
2013-05-29 13:43   ` Felipe Contreras
2013-05-29 13:54   ` Nicolas Desprès

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.