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

.gitignore location differs from documentation (magento-root-dir setting) #120

Open
tkdb opened this issue Jul 9, 2014 · 6 comments
Open

Comments

@tkdb
Copy link
Contributor

tkdb commented Jul 9, 2014

In documentation it's written that .gitignore will be loaded from the current directory:

The .gitignore file will be loaded from the current directory, and if it does not exist, it will be created. Every set of module files, will have a comment above them describing the module name for clarity.

I did read that as the working directory and/or as the composer working directory (the directory in which the composer.json is located).

However by having

    "extra": {
        "magento-root-dir": "magento/",
        "auto-append-gitignore": true
    }
}

the file is created in:

magento/.gitignore

Is this intended? It requires me to handle an additional .gitignore file and I also need to block access to it, because that is a public folder (like in the htdocs example given in the documentation).

It's no problem for me to handle this, but I thought it's worth to report. Feedback appreceated what an ideal/intended behavior would be.

@tkdb tkdb changed the title .gitignore location differs documentation .gitignore location differs from documentation (magento-root-dir setting) Jul 9, 2014
@AydinHassan
Copy link
Member

When I wrote in, and the docs, I created it in the project root, eg composer root. I think @Flyingmana changed this to the Magento root. So docs probably need updating :)

@tkdb
Copy link
Contributor Author

tkdb commented Jul 9, 2014

Thanks for the info. Perhaps he can also say why he did so, that would be good to know. A related change might be 230dbdc

@Flyingmana
Copy link
Member

yeah, the reason was, because the magento deploy path could be outside the composer root, also it did mess with the unittests

will update the docu soon

@tkdb
Copy link
Contributor Author

tkdb commented Jul 9, 2014

while you're at it you could perhaps look for a nice place to leave a hint/notice in the installation instructions for those users unaware that the .gitignore is potentially accessible publicly via the webserver.

@tkdb
Copy link
Contributor Author

tkdb commented Jul 10, 2014

And another note perhaps worth if someone wonders: If you committed in development already the changes for that .gitignore but due to some reason the file get's modified differently on stage/live with a git based deployment, you might end with uncommitted changes. One could exclude the .gitignore in that magento root folder, however this might turn out not-working for other scenarios in which that file isn't purely automatically generated. I mostly experience this, because in 2.x the generation of the .gitignore file was fixed.

@michael-bouvy
Copy link

Hi,

Maybe allowing to specify where the .gitignore file will be written could be a good option?

I prefer keeping all my ignores in a single .gitignore file.

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

No branches or pull requests

4 participants