Skip to content

Update to directly use git to calculate changes for diffs - #82

Open
jackbentley wants to merge 1 commit into
nhat-phan:masterfrom
jackbentley:feature/fix-bad-diffs
Open

Update to directly use git to calculate changes for diffs#82
jackbentley wants to merge 1 commit into
nhat-phan:masterfrom
jackbentley:feature/fix-bad-diffs

Conversation

@jackbentley

Copy link
Copy Markdown

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.

@nhat-phan nhat-phan self-assigned this Jul 22, 2020
@nhat-phan

Copy link
Copy Markdown
Owner

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.

@Nico04

Nico04 commented Oct 16, 2020

Copy link
Copy Markdown

Any news on this MR ?

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

Successfully merging this pull request may close these issues.

Wrong file revisions are taken in code review

3 participants