Update to directly use git to calculate changes for diffs #82
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.