https://pantsbuild.org/ logo
h

hundreds-breakfast-49010

09/24/2020, 11:58 PM
me and @hundreds-father-404 are considering the possibility that having
.*/
as a default ignore pattern in the
--build-ignore
and
--pants-ignore
might be undesirable
w

witty-crayon-22786

09/24/2020, 11:59 PM
why, what is getting ignored that shouldn’t be?
h

hundreds-father-404

09/24/2020, 11:59 PM
specifically now that we read from your
.gitignore
. My argument is that it will already ignore things like
.idea/
that you don’t want The other argument is that it’s much easier to add to
pants_ignore
than to take away
Stu, see https://pantsbuild.slack.com/archives/C046T6T9U/p1600970638032400 We’ve been having a hell of a time to get the
.ci
folder read
w

witty-crayon-22786

09/25/2020, 12:00 AM
Copy code
pants_ignore.add = ['!.ci']
right?
h

hundreds-breakfast-49010

09/25/2020, 12:00 AM
part of the problem here is that the behavior of the gitignore matching library we use and how it interacts with various things pants does with the filesystem is confusing
we also need
build_ignore = ['!.ci']
.add
is actually either broken there right now, or I misunderstand something about how the git ignore syntax works
w

witty-crayon-22786

09/25/2020, 12:01 AM
but yea, i think the “reading the gitignore” support does maybe change the equation there.
h

hundreds-breakfast-49010

09/25/2020, 12:01 AM
one issue there though
is that I think most .gitignore files don't actually ignore .git itself
h

hundreds-father-404

09/25/2020, 12:02 AM
Yeah, they don’t. We’d for sure want to add
.git
explicitly, and other popular VCS directories
h

hundreds-breakfast-49010

09/25/2020, 12:02 AM
another issue is that if a pants user is using a non-git vcs, some stuff might break unexpectedly
although I think we might say that we only explicitly support git?
git is one of those things where it's common enough that most people us it, but there's enough people not using it that we would like to not cause problems for them by accidentally relying on the presence of a
.gitignore
file
h

hundreds-father-404

09/25/2020, 12:03 AM
is that if a pants user is using a non-git vcs, some stuff might break unexpectedly
My argument here is that it’s easier for us to help a user fix this than it is to un-ignore something. Also, that it’s less likely of a problem than the problem Thales is having of “WTF is Pants not reading this. It exists!”
w

witty-crayon-22786

09/25/2020, 12:03 AM
we also need 
build_ignore = ['!.ci']
we should definitely remove
.*
from the default
build_ignore
if it is already in
pants_ignore
👍 1
h

hundreds-breakfast-49010

09/25/2020, 12:03 AM
that might actually entirely solve his problem
except that it's a bit confusing (at least I think it's confusing) that we need to specify
!/.ci
and not
!/.ci/*
h

hundreds-father-404

09/25/2020, 12:04 AM
although I think we might say that we only explicitly support git?
I don’t think so.
--changed-since
won’t work, and you’ll have to use a bit more work for
pants_ignore
. But otherwise no reason to require Git
w

witty-crayon-22786

09/25/2020, 12:04 AM
that’s how gitignore syntax works, afaik
h

hundreds-breakfast-49010

09/25/2020, 12:05 AM
it actually might make sense to try to run pants in an environment without git, just to make sure there's nothing unexpected going on
👍 1
that's a bit tangential to this conversation though
h

hundreds-father-404

09/25/2020, 12:06 AM
it actually might make sense to try to run pants in an environment without git, just to make sure there’s nothing unexpected going on
This is the type of stress testing we need to do for 2.0. Try to break Pants as much as we can
h

hundreds-breakfast-49010

09/25/2020, 12:07 AM
anyway yeah if we remove
.*/
from teh --build-ignore defaults, then all we have to do to solve thales' problem is make sure
"!/.ci",
is in the --pants-ignore, which is sensible enough
h

hundreds-father-404

09/25/2020, 12:07 AM
Definitely better. I’d still recommend removing
.*
from the default for
pants_ignore
to be an explicitly enumerated list like
[.git, .svn]
But yeah, at least that’s an improvement
h

hundreds-breakfast-49010

09/25/2020, 12:09 AM
I'm gonna put a PR for the first one. the second one might or might not be a good idea, I think we should think a bit more if we can come up with a good explicitly enumerated list of common dot-dirs
👍 1