I'm not primarily a Java/Kotlin developer so this took some time to figure out. There's might be some mistakes and there might well be a better way of doing this.
I know that these changes won't be compatible with the feature that allows you to select which commits to review from the MR. This will now only allow you to compare the source and target branch.
From what I can gather the plugin currently calculates the changes by combining the changeset of the commits in the MR.
For example, if the two branches are updated simultaneously and merged together, you will end up seeing the changes from the target branch/merge commit in the diff.
This isn't the same as a git diff.
The changes I've made make it the exact equivalent of running git diff <target>..<source> (because it actually runs that command).
Given that it now runs the commit command, it means it's obviously only compatible with Git but I don't think that's an issue as other parts of the plugin are tailored to git only.
In order to re-implement the "select commits to compare" feature, you will likely need to use the merge-base command as explained here or find another way of doing what the MR does.
Thanks for contribution, based on this I'll fix a commits problem add add new option in the configuration, then users have a choice to pick between 2 methods.
Fixes #72
I'm not primarily a Java/Kotlin developer so this took some time to figure out. There's might be some mistakes and there might well be a better way of doing this.
I know that these changes won't be compatible with the feature that allows you to select which commits to review from the MR. This will now only allow you to compare the source and target branch.
From what I can gather the plugin currently calculates the changes by combining the changeset of the commits in the MR.
For example, if the two branches are updated simultaneously and merged together, you will end up seeing the changes from the target branch/merge commit in the diff.
This isn't the same as a
git diff
.The changes I've made make it the exact equivalent of running
git diff <target>..<source>
(because it actually runs that command).Given that it now runs the commit command, it means it's obviously only compatible with Git but I don't think that's an issue as other parts of the plugin are tailored to git only.
In order to re-implement the "select commits to compare" feature, you will likely need to use the
merge-base
command as explained here or find another way of doing what the MR does.