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

How to debug merge driver when it fails? #15

Open
k0pernikus opened this issue Aug 4, 2020 · 1 comment
Open

How to debug merge driver when it fails? #15

k0pernikus opened this issue Aug 4, 2020 · 1 comment

Comments

@k0pernikus
Copy link

k0pernikus commented Aug 4, 2020

I'm getting an error on merge:

Auto-merging composer.lock
CONFLICT (content): Merge conflict in composer.lock
Auto-merging composer.json
Automatic merge failed; fix conflicts and then commit the result.

I am a newbie to merge drivers and would like to provide more information to you, yet since it's a private and proprietary project I don't know if I can share the conflicting composer.lock file yet.

Yet is there a way I could generate an error message that may be of use to you?

I would like to manually invoke the merge-driver by feeding it two versions of the composer.lock files and then see an error message.

Could you please pinpoint me on how I could achieve that?

@imme-emosol
Copy link

As far as I can tell from git's manual ( https://www.git-scm.com/docs/gitattributes#_defining_a_custom_merge_driver ), you'd need to have several files & could then do a step debug in php-cli.

(
# path to a file with the contents of your "previous" composer.lock ~ %O
ancestorfile=''
# path to a file with the contents of your current composer.lock ~ %A
oursfile=''
# path to a file with the contents of the conflicting composer.lock ~ %B
theirsfile=''
# the conflict marker size, default is 7 ~ %L
cmsize=''
# the path where git would write stuff to (path is used in the script) ~ %P
outfile=''

php composer-git-merge-driver "${ancestorfile}" "${oursfile}" "${theirsfile}" "${cmsize}" "${outfile}"
)

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

2 participants