-
Notifications
You must be signed in to change notification settings - Fork 7
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
Pre-commit hook to regenerate composer lock hash? #3
Comments
Just out of curiosity, why can't the hash be generated when performing the merge? |
@eelkeblok there are a few issues that make it problematic:
So really it only makes sense to do this right before a commit is made so that all the dust settles (both files are merged and conflicts have been resolved). This would ensure it is run consistently (after a merge conflict or not) and only once per merge. |
Interesting. I would've expected the content hash is only derived from the contents of the composer.lock, so that with the result of the merge you'd have all information needed to regenerate (provided there are no conflicts based on the enhanced merging this project enables). That does make this quite a bit less useful than I thought; the hash is often is the only merge conflict based on regular text-based merging. |
You're right, if that is the primary merge conflict you face. However, that is also the easiest conflict to fix. Simply remove the entirety of the conflict markers and conflicting lines pertaining to the content hash, save the lock file, then run |
Well, yes, but exactly because it’s so easy I was looking for a way to automate it. We use a pull request workflow which will obviously fail to merge something when there is a merge conflict and with various branches adding different composer packages, we are guaranteed to be “solving” various such conflicts a day. |
Check for our special message and regenerate the hash as necessary - this would be an optional hook to add, of course.
The text was updated successfully, but these errors were encountered: