-
Notifications
You must be signed in to change notification settings - Fork 430
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
GrumPHP relative config path doesn't work #294
Comments
The config parameter was added for projects with strange folder structures. It is not ok to remove this entirely. I thinnk the solution is to keep the path relatively. |
@veewee That solution doesn't make sense because the relative path is causing the problem. If you think we need to keep the config parameter in the git hook, either the path needs to be absolute or the relative path resolution needs to be fixed. However, I think it's strictly incorrect to have the config parameter specified in the git hook because any project that needs a custom config location, no matter how "exotic", can simply specify it in the Composer config. Why does it need to be duplicate in the git hook? Furthermore, why does the relative path resolution specified on the command line use a different (broken?) resolver to the one specified in the Composer "extra" config? |
We really should take a look at all the paths that are being used. They currently solve a lot of problems: local installation, global installation, vagrant installations, .... It is not a good idea to just remove theses lines of code because it most likely solves another issue. Normally relative paths should work just fine, but then again: they are based on realpaths which might cause other issues. |
Since the path system got a rewrite in #644 which supports relative config paths in composer, I am closing this issue for now. |
Given that my composer.json contains the following
When I run
git commit -a
I see the following error.I do not know why this is happening now. I could have sworn this was working but now it definitely does not. No amount of
git:deinit
/git:init
is helping alleviate the problem. Nevertheless, the file definitely exists.Update
I have nailed down exactly how and when this occurs and why it used to seem to work.
I have observed that changes to
composer.json
'sextra
parameter are picked up immediately by GrumPHP. This can be observed by running the binary because it outputs the default config path in the console usage, which changes as soon as theextra
parameter is updated.However, if the extra parameter is set during
git:init
it modifies the git pre-commit hook to include the relative config parameter which overrides the absolute default. Therefore, the fix should simply be to stop passing the config path in the git hook!The text was updated successfully, but these errors were encountered: