magento-hackathon / magento-composer-installer

Composer installer for Magento modules
210 stars 154 forks source link

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

Open tkdb opened 10 years ago

tkdb commented 10 years ago

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.

AydinHassan commented 10 years ago

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 commented 10 years ago

Thanks for the info. Perhaps he can also say why he did so, that would be good to know. A related change might be https://github.com/magento-hackathon/magento-composer-installer/commit/230dbdc2181cbf997cd6a5369088d23ca7c4c800

Flyingmana commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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 commented 9 years ago

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.