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 #3282

Closed
wants to merge 3 commits into from
Closed

Update WordPress.gitignore #3282

wants to merge 3 commits into from

Conversation

@Triloworld
Copy link

@Triloworld Triloworld commented Jan 7, 2020

Hello all and thanks to create great file.
There is problem to find proper meaning of content for this file in this repo.
My propose need review as I have different, more direct approach with fix expectation.

  1. Header. To know what rules are used, and be apply to project after using template. Errors can be removed, updates won't be broken and clearly show why I using that file.
    Now: Any changes are confused.
    After: Rules are in header

  2. Introduce link to Github where template is created. Like a template, this can be modified so no big deal. Used as link where to watch. For this pull request nobody will update their gitignore file just because that link don't preexist from copy & paste.
    Now: Manually fixing and no connection to place where file come from.
    After: Can be used to update if some bugs will be introduce.

  3. Core Files need to be ignored (clue from comment) but there was broken part:
    Solution apply and work (thx. @stkrzysiak) : https://github.com/github/gitignore/pull/3093/files/1115dec039582df7242acd588811357f76d610ce#diff-f2cf96854b528e9828c4ca34a4917e54
    Now: All root catalog was added ;/
    After: Just some will be excluded

If core file need to be included, then we need fix other parts as and new pull request:

  • /wp-content/language
  • /wp-content/index.php (security bug when someone use apache listings)
  1. Thanks @chougran
    #3125
    This is most important as gitignore provide solution to sensitive credentials.
    Now: wp-config leak
    After: Configuration is safe :)

  2. License
    As they can be manually edited for adding more software (bundle of license) then is out of scope for ignoring it in this particular template. Rule is to add wordpress context stuff that are repeated every new repository is created. Maybe add clue that need to be handled manually? or just header that Wordpress use particular one.

It is tested on: WP 5.3.2
Used: Custom theme + custom plugin (they language are ignore but can be download from dashboard)

Comments appreciate as my first post here :)

Triloworld added 3 commits Jan 7, 2020
Hello all and thanks to create great file.
There is problem to find proper meaning of content for this file in this repo.
My propose need review as I have different, more direct approach with fix expectation.

1. Header to know what rules are used and be apply to project after using template. Errors can be removed, updates won't be broken and clearly show why I using that file. Right now, any changes are confused. This file many people use many times.

2. Introduce link to Github where template is created. Like a template, this can be modified so no big deal. Used as link where to watch. For this pull request nobody will update their gitignore file just because that link don't preexist from copy & paste.
I see that some files have it so suggestion welcome.

3. Core Files need to be *ignored* (clue from comment) but there was broken part:
Solution apply and work (thx. @stkrzysiak) : https://github.com/github/gitignore/pull/3093/files/1115dec039582df7242acd588811357f76d610ce#diff-f2cf96854b528e9828c4ca34a4917e54
Otherwise, all root catalog was added ;/

If core file need to be *included*, then we need fix other parts as :
- /wp-content/language
- /wp-content/index.php (security bug when someone use apache listings)

4. Thanks @chougran
#3125
This is most important as gitignore provide solution to sensitive credentials. 

Comments appreciate :)
Core file that was introduced to block listing. They are traced by Wordpress developers and are part of package
Adding "/*" introduce bug where self (Wordpress.gitignore or .gitignore) file isn't added to git. This file is part of project that downloaded, will guard other people to upload improper files.
node_modules/

# ignore log files and databases
# Log files and databases
*.log
*.sql

This comment has been minimized.

@pedrosanta

pedrosanta Jan 22, 2020

Why are we ignoring .sql files? Do they naturally come/are generated on a typical WordPress installation? Aren't we over-assuming this?

This comment has been minimized.

@Triloworld

Triloworld Jan 22, 2020
Author

Wordpress require SQL database. I don't find that they pre-exist on first installation.
Remove it? I don't see value to have it in this ignore file template

This comment has been minimized.

@pedrosanta

pedrosanta Jan 23, 2020

Yes, I think the *.sql and *.sqlite rules should be removed. I know some people might have them as part of their workflows, but I see this gitignore repository more as base/starter gitignore files, that can be mixed together (like using gitignore.io)

I see these files only containing (1) the specific files for each technology/tool and (2) and possibly rules for widely common configurations of such technologies/tools (ex: *.log line).

Also, they shouldn't have redundant lines that are covered by other specific gitignores (ex: Global/macOS.gitignore).

Project/workflow specific rules should be added/maintained individually on each project, IMHO.

This comment has been minimized.

@pedrosanta

pedrosanta Jan 23, 2020

Btw, added my own contribution addressing the above and more on #3295.

@shiftkey
Copy link
Member

@shiftkey shiftkey commented Mar 12, 2020

Closing this out in favour of #3295 which seems to most detailed discussion

@shiftkey shiftkey closed this Mar 12, 2020
@Triloworld
Copy link
Author

@Triloworld Triloworld commented Mar 12, 2020

Why part of solution was rejected when really it was accepted?
This PR's can be merged, some small fix needed to be done before.
Discussion of #3295 can be really long when my fix just are in place of some problem when I use that template.

@Triloworld
Copy link
Author

@Triloworld Triloworld commented Mar 12, 2020

I propose fix to pull request:

  • revert "catch-all" after community decide what can be done there and better, tested declarative solution will be
  • Remove logs, added in other pull request when there will be evidence that starter template need that
@shiftkey
Copy link
Member

@shiftkey shiftkey commented Mar 12, 2020

@Triloworld I'm not opposed to interim fixes while #3295 goes on, it just wasn't clear to me whether this PR was active based on the discussion.

I propose fix to pull request:

  • revert "catch-all" after community decide what can be done there and better, tested declarative solution will be
  • Remove logs, added in other pull request when there will be evidence that starter template need that

Please open up PRs for these changes, as they feel like they are a step in the right direction.

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

3 participants