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

"Open Line Changes with..." doesn't work for renamed files #552

Closed
philraj opened this Issue Nov 19, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@philraj
Copy link

philraj commented Nov 19, 2018

Issue Type: Bug

After renaming a file, when you try to e.g. Compare Commit with Previous it shows an empty file on the right pane, and the titlebar shows that GitLens thinks the file has been deleted from the perspective of the current commit.
image
This is despite the fact that the inline git blame is correctly following the rename.

Steps to reproduce:

  1. Create a blank git repo locally
  2. Create a file, add some contents, commit the change
  3. Edit the file, commit the change
  4. Rename the file, commit the change
  5. Try to Compare Commit with Previous and notice that the right pane shows an empty file

Extension version: 8.5.6
VS Code version: Code 1.29.1 (bc24f98b5f70467bc689abf41cc5550ca637088e, 2018-11-15T19:06:21.742Z)
OS version: Darwin x64 17.7.0

@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented Nov 27, 2018

@philraj Can you try again with the GitLens 9 beta release to see if you still have the issue? It seems to be working for me.

@philraj

This comment has been minimized.

Copy link

philraj commented Nov 27, 2018

Yep, still happening in 9 beta. Here's what happens when I run the two comparison commands (new wording seems less intuitive than "Compare Commit with..." but maybe that's just me):


Open Line Changes with Previous Revision:

image


Open Line Changes with Working File:

image

You don't have that issue when you follow those steps?

@eamodio

This comment has been minimized.

Copy link
Owner

eamodio commented Nov 27, 2018

@philraj what exactly are the steps you are following?

Hrm, I've constantly struggled with the naming of that command. I want to make it clear that it is line specific, rather than file specific -- e.g. just walking back to the previous commit of the file. And rather than calling it Compare Line Commit with..., I've aligned with vscode's terminology for diff comparisons -- as they use Open Changes

@philraj

This comment has been minimized.

Copy link

philraj commented Nov 27, 2018

Oh, you want to emphasize that the commit you're comparing with is the one from that specific line. I think "Compare Commit with..." was the most ergonomic one so far (I think I saw a few of the previous ones) but you're right, it's tricky to find the right wording that's clear but not too verbose. ("Open Changes Between This Line's Commit And The Revision Before It" doesn't really roll off the tongue)

The steps I'm following are the same I listed in the original bug report, but just to make sure you can follow exactly in my footsteps:

  1. Create a new directory and enter it
  2. git init
  3. touch abc.js
  4. Open it in vscode, add some text, save
  5. Commit changes
  6. Edit the text
  7. Commit changes
  8. Rename the file to cba.js from vscode
  9. Commit changes
  10. Now try a comparison of the line you changed as shown above

Your git log should show 3 commits: 2 which change the file contents, and one which is a rename.

@eamodio eamodio changed the title "Compare Commit with..." doesn't work for renamed files "Open Line Changes with..." doesn't work for renamed files Dec 10, 2018

@eamodio eamodio added bug and removed needs more info labels Dec 10, 2018

@eamodio eamodio self-assigned this Dec 10, 2018

@eamodio eamodio added this to the Soon™ milestone Dec 10, 2018

@eamodio eamodio closed this in 28034ce Dec 12, 2018

@philraj

This comment has been minimized.

Copy link

philraj commented Dec 18, 2018

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment