Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Wordpress.gitignore #3093

Open
wants to merge 1 commit into
base: master
from
Open

Conversation

@samuraijane
Copy link

@samuraijane samuraijane commented Jun 22, 2019

Reasons for making this change:
This file is missing /* to begin with ignoring everything. I have also added a line to ignore Mac's .DS_Store, several of which appear within the directories that belong to wp-content.

TODO

Links to documentation supporting these rule changes:

TODO

If this is a new template:

  • Link to application or project’s homepage: TODO
This file is missing `/*` to begin with ignoring everything. I have also added a line to ignore Mac's `.DS_Store`, several of which appear within the directories that belong to `wp-content`.
!wp-content/

# ignore Mac OS file that stores custom attributes for its containing folder
.DS_Store

This comment has been minimized.

@shiftkey

shiftkey Jun 23, 2019
Member

These rules are covered by Global/macOS.gitignore.

Please omit this change as it is not specific to Wordpress.

This comment has been minimized.

@thatnerdjosh

thatnerdjosh Sep 10, 2019

Agreed, also !.gitignore should be added so we can add the .gitignore to the repo :P

This comment has been minimized.

@pedrosanta

pedrosanta Jan 22, 2020

+1 on both. I think we should have clear separation of concerns on these files—hence I have some serious doubts if, for example, *.sql files exclusion should be here in the first place if it's not something that occurs/is generated naturally on a typical WP install. (Want to bring everyone to attention that own project/personal rules, should probably be applied by oneself individually on each project .gitignore alongside these general contrib rules, to avoid the risk of possible workflow enforcement onto others.)

Having each file handle the specific files of each library/component/platform, allows for better combination of several of these files, but also for utils like gitignore.io.

This comment has been minimized.

@Triloworld

Triloworld Feb 10, 2020

".DS_Store" line will be removed from this push as @shiftkey and @NerdsvilleCEO is right

@@ -1,6 +1,10 @@
# ignore everything in the root except the "wp-content" directory.
/*

This comment has been minimized.

@shiftkey

shiftkey Jun 23, 2019
Member

This file is missing /* to begin with ignoring everything.

Are you able to share some context about why this is a safe change to make?

This comment has been minimized.

@stkrzysiak

stkrzysiak Jul 28, 2019

Without /* the negated lines(like !wp-content) are irrelevant. This whole file is built on the concept that only the negated lines are to be included, for that to work everything must be excluded initially.

This comment has been minimized.

@Triloworld

Triloworld Jan 7, 2020

Yep, @stkrzysiak is right. Right now part with "!wp-content/" don't work ;/
We need that "/*" . Otherwise files of core wordpress are now added to change

This comment has been minimized.

@pedrosanta

pedrosanta Jan 22, 2020

I want to pick up on @shiftkey comment, namely about the safety aspect of that specific /* rule—I assume that was something along this line @shiftkey might be referring to.

Wasn't better (and safer, more below) if instead of a catch-all approach like that, we should opt for a more declarative way of stating the folders we want to see ignored instead?

I'm concerned that using the 'catch-all' approach we might raise some conflict with other .gitignores, or hinder if one wants to mix-and-match several of these .gitignore files like on gitignore.io and some technology requires some folder on the root to be added that would be caught by this rule, etc.

Does this makes sense?

This comment has been minimized.

@pedrosanta

pedrosanta Jan 23, 2020

FYI, added the #3295 PR that addresses my concern above.

This comment has been minimized.

@Triloworld

Triloworld Feb 10, 2020

I will redo this to change to previous to enable this pull request to be merge and close some issues.
This need to be fixed in #3295 with another pull request after all paths are declarative and battle tested for errors
Thank you @pedrosanta for helping understand better context

This comment has been minimized.

@Triloworld

Triloworld Feb 10, 2020

Declarative way is better imho. Need to be discuss on approach and tests

This comment has been minimized.

@pedrosanta

pedrosanta Feb 10, 2020

Yes #3295 has a declarative approach, I based it mostly on folders from a fresh WP install, and tested it, but a couple common folders on WP ecosystem might or nor be missing, but then again I have the strong feeling we should only add into .gitignore what is generally assumed as widely as possible as a common practice/setup on WP ecosystem. Because of course YMMV and it's supposed for you to branch of the .gitignore, and then add rules for your particular setup.

@pedrosanta
Copy link

@pedrosanta pedrosanta commented Jan 22, 2020

Also, should we close this one in favor of #3282 or #3295?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants