Skip to content

Conversation

dschaper
Copy link

@dschaper dschaper commented Jan 1, 2018

A .gitignore file of * in the same directory that is the target to being ignored will recursively ignore the .gitignore.

Changing the glob to [^.gitignore]* will ignore all files that are not in the regex [.gitignore]. Keeps IDE's like IDEA from complaining that you're tracking an ignored file.

A `.gitignore` file of `*` in the same directory that is the target to being ignored will recursively ignore the `.gitignore`. 

Changing the glob to `[^.gitignore]*` will ignore all files that are not in the regex `[.gitignore]`. Keeps IDE's like IDEA from complaining that you're tracking an ignored file. 

Signed-off-by: Dan Schaper <dschaper@ganymeade.com>
@nkakouros
Copy link
Contributor

Seems good to me. Why not add a test that checks it too?

@mbland
Copy link
Contributor

mbland commented Jun 1, 2018

I think a better expression may be:

*
!.gitignore

Can you give that a spin and see how it works? I'm concerned that what [^.gitignore]* actually does is ignore any file that doesn't start with ., g, i, t, etc.

@jasonkarns
Copy link
Member

Is there a reason we need the test/tmp dir to exist at all? I'm personally strongly in favor of centralizing the ignore rules in /.gitignore rather than having them dispersed throughout the codebase.

Bonus: /test/tmp in the root gitignore, will solve this issue of a versioned file being matched by the ignore rules.

@mbland
Copy link
Contributor

mbland commented Jun 1, 2018

It's used in the test for setup and teardown. We could update the tests to do something differently. (I've a few minor cleanup ideas; this could be one of them.)

@jasonkarns
Copy link
Member

Perhaps we make the test robust to create it as necessary instead of versioning empty placeholder? That's typically my preference anyway, instead of committing cruft that are tertiary to the repo's purpose. (And eventually succumb to tragedy of the commons.)

@mbland mbland closed this in 30e51ab Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants