Ocramius / PackageVersions

:package: Composer addon to efficiently get installed packages' version numbers
MIT License
3.22k stars 67 forks source link

src/Packages/Versions.php changes detected in composer install #138

Closed Taluu closed 4 years ago

Taluu commented 4 years ago

Even though /src/Packages/Versions.php is in the .gitignore, for some reasons changes are still detected when I go into vendor/ocramius/package-versions and thus through composer install which asks me each time to discard or not changes (which I happily do) when updating this package.

But, sometimes I can't do that as I need to do it automatically, and running with --no-interaction is not sometimes possible (I may have other packages in which I want to actually make a choice, could be this one if not for the generated Versions file though).

It seems that git doesn't really like to have in gitignore (using 2.26 atm) files that were already added, and still somehow tracks changes made to this file.

I guess that transforming this file into a "template" that is tracked and then used as is on a fallback mode is out of the question, as the point is that if --no-scripts or --no-plugins or something of the sort is ran the fallback is used ?

I don't have any other clues for that though, except I guess I will be using the --no-interaction mode I guess...

Ocramius commented 4 years ago

Hmm, this probably happens with source installations (rare, although possible)

Taluu commented 4 years ago

This happens a lot with phpactor on my vim installation, and it is not ran with --prefer-dist so I guess it picks source by default indeed.

Ocramius commented 4 years ago

The default picks the downloadable package if you don't have zip or ext-zip installed, or if you use --prefer-source

Taluu commented 4 years ago

Hum, I do have the ext-zip extension and zip installed and I don't use prefer-source nor do I have any config in composer asking to prefer using --prefer-source (which I prefer TBH so it kind of arranges me), but I do have in the vendor folder on this project (and others) a git history on each packages.

I don't if I use --prefer-dist though.

Note : preferred-installed setting seems to be on both the global and the package side on auto

xxorax commented 4 years ago

I confirm there is NO .gitignore after installing it by composer.

Taluu commented 4 years ago

There's one, it's just somehow ignored by git (that directive at least), because it is already versionned / tracked

Ocramius commented 4 years ago

Requires #139