I want to resolve conflicts on a pom.xml merge by taking always the version of the destination branch. In plain git this would be possible with a merge driver.
How can i realize this with on a stash pull request?
Community moderators have prevented the ability to post new answers.
How did you configure stash to use your custom merge driver?
Hi,
i wrote an java merge driver, which you can configure. Right now it adjust's the parent and project version and only them (no xml structure or dependency version changes). If you want, you can auto resolve property conflicts too. Have a look on my project on github.
Greetings,
Sven
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is great news, that way I can reuse my own merge driver too. Thanks Andreas! I guess you answered your own question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You don't need to configure Stash. Stash uses the standard Git installation so you only need to configure your Git / the Git config of the user that runs Stash.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried using a .gitattributes file to specify merge a strategy for this file?
https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not that easy. Sometimes you want to do a normal merge except for the project version. Thus the merge driver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have perl 3 on the server you could try the merge driver I'm using: https://github.com/agusmba/pom-merge-driver It works by changing my local pom version to the meging one in order to avoid conflicts, but reverts the change after the merge (before the commit). Only when merging to the "master" brach does the merge driver keep the new pom version instead of reverting to the previous one. Please note that I did not write the driver, only modified it to meet my needs, and I'm in no way a perl expert.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I managed to implement and install a mergedriver that takes the version from to local pom and writes it in the other pom.xml before it executes git merge-file but ran into another problem: https://answers.atlassian.com/questions/8618847
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
have you tried to install the custom driver on your stash server (and stash user)?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I come from fixing many of my pom.xml problems via a custom merge driver, so this is indeed a good question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.