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
Opening Ahead/Behind files isn't showing the desire diff (e.g. diff with the merge base) #1218
Comments
That option was removed with the change in how the comparison works now -- with the Behind and After groupings. Is there a particular use case that you are trying to accomplish? |
I'm missing this one, too. It's more close to the way Git works, i.e. I'm using the shell:gitlens:bitbucket ui in approximately 1:1:1 fractions, that means I still need to know what gitlens is doing since I need to reproduce it in the terminal, too. By looking at the log I could see that there are still two and three dot comparisons, but it's not that clear anymore from the UI. Use case is to switch between a "full diff" and a "merge diff", e.g. to check pull requests. |
@eamodio I used the three dot diff to perform code reviews. With Gitlens now, if I compare two branches it has sections for Behind and Ahead, and within those sections it shows the changed files within those commits (e.g. 48 files in the Behind section and 15 files in the Ahead section), except if you open the files to see how they were changed it shows a diff with changes from both branches - so you can't tell if the changes were added in the current branch or changes made to the comparison branch (which I'm not code reviewing.) With winmerge configured as my diff viewer If I run For my use-case I don't think I need the two/three dot switch anymore but when opening a file under the 'files changed' section of Behind or Ahead I think it should only show the diff from changes made in that branch's commits. |
I used frequently the two/three dot comparison when cherry-picking. A very common use case is when one is developing in a devel branch and wants to cherry-pick a subset of relevant commits that will go in a feature branch which will then be submitted as a PR. The new comparison mode with behind and after groupings is convenient when merging branches, but is not well suited for cherry picking: it can happen that the diff of a file between the two branches is empty (as per e.g. Being able to choose the comparison mode would be a great feature, it is the only thing keeping me from upgrading at the moment to version >= 11. |
Same here. Hopefully it's just a temporary bug! |
Agree with all comments above. Three-dot comparison is essential for code reviews, so from that perspective the feature is broken. Please please raise the priority of this issue. Thank you for all the hard work Eric! |
@jods4 Can you expand upon the diff not being coherent?
What do you mean by this? Are you saying that when you click on a file under I want to understand this so I can get it fixed up ASAP. |
Also can anyone give me an example from a repo that shows the desired behavior in GitLens 10 vs the undesired in GitLens 11? |
@eamodio That makes sense because Behind is what you missed from the other branch, i.e. Looks like currently the files lists match this behaviour, but when I open the actual file diff it is always 2 dots If it worked properly, for me it would be a good enough substitute for the v10 three-dots feature (which was arguably rather obscure to people who aren't very familiar with git). |
I've made a change to the x files changed nodes under both Ahead & Behind, now when opening a diff it will be a diff between the merge base and the tip. So x files changed under Behind will now only show changes that were made on the comparee branch, while under Ahead it will only show changes that were made on the comparer branch. While the root x files changes node will continue to be a comparison between the comparee and comparer as it is today. Can you please verify this fix in tomorrow's insiders edition? You can install the insiders edition from here. Be sure to disable/uninstall the stable version of GitLens first. |
@jods4 @jopotts @fevb @obambrough @jankap @SamBreaksThings Thoughts? |
@eamodio I disabled gitlens, reloaded VS Code, installed the insider edition (2020.12.2304) and reloaded VS Code again. I then compared a branch against the master branch but there was no difference in behaviour for the ahead/behind files. If I expand the ahead node and then expand the files changed node and look at one of the files that I know was changed in both branches I am seeing a diff that contains the changes from both branches, not just the changes in the current branch (which is what the triple dot diff would give me.) e.g. master/task.py:
pr-343/task.py: then do the compare of pr-343 with master I only want to see the one line that was changed in that PR but what I see under the ahead/files changed node is:
This was the same behaviour I was seeing with the regular gitlens (not insiders edition.) |
@obambrough Hrm -- what do you get if you run |
Nothing is returned when I run the |
Awesome. Thanks for the info. Should make an easy fix! |
@obambrough I pushed the fix to both the latest insiders and the 11.1 stable release. |
I tested against the GitLens (Insiders) 2020.12.2400 and it worked great! The ahead/behind files changed nodes provide a diff that shows what changed in the respective branches and the files changed node (that isn't underneath the ahead/behind node) shows a diff between the current HEAD of each branch. I can't speak for the others but I think this achieves allowing me to perform a code review which is what I used the three dot option for in the older Gitlens version. Thank you! |
@eamodio sorry I was on a holiday break. |
Sorry for the late response, I am also satisfied with the new behavior for the cherry-picking use case I mentioned before. I can now use the 'files changed' group instead of the before and after groups in the compare section. Thank you! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Earlier there used to be an option to switch between three/two dot comparisons. I can't seem to find that option now (after moving to Source Control tab). It's by default comparing in full-mode.
The text was updated successfully, but these errors were encountered: