Skip to content

Opening revision of a renamed file is broken #3050

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

Closed
eamodio opened this issue Dec 11, 2023 · 9 comments
Closed

Opening revision of a renamed file is broken #3050

eamodio opened this issue Dec 11, 2023 · 9 comments
Assignees
Labels
needs-verification Request for verification
Milestone

Comments

@eamodio
Copy link
Member

eamodio commented Dec 11, 2023

  • Open a project in vscode
  • Rename a checked (committed) in file from x.js to x.ts or similar
  • Open the file in vscode
  • Trigger the "Open file at revision..." command

Expected behaviour: be presented with a revision picker
Actual behaviour: "Unable to show commit history"
Screenshot 2023-12-07 at 11 28 53

Nothing logged to the GitLens output

Originally posted by @mogelbrod in #708 (comment)

@eamodio eamodio self-assigned this Dec 11, 2023
@eamodio eamodio added this to the 14.6 milestone Dec 11, 2023
@eamodio eamodio added the bug label Dec 11, 2023
@eamodio eamodio added pending-release Resolved but not yet released to the stable edition needs-verification Request for verification labels Dec 11, 2023
@eamodio
Copy link
Member Author

eamodio commented Dec 11, 2023

@mogelbrod Can you please verify this fix in tomorrow's (v2023.12.12xx) pre-release edition of GitLens? Thank you so much!

You can switch to the pre-release edition of GitLens, by clicking on the "Switch to Pre-Release version of this extension" from the Extensions view.

image

@mogelbrod
Copy link
Contributor

@eamodio I seem to be stuck on v2023.12.1104 no matter how many times I switch between pre-release and release version, even after reloading and restarting vscode 🙁
Screenshot 2023-12-12 at 10 00 18

@mogelbrod
Copy link
Contributor

v2023.12.1204 appears to have been released now 👍 After installing it I'm still seeing the same issue though, unfortunately. I can consistently repro it by opening a git repo, renaming any file, opening it in the vscode editor and triggering "Open Changes With Revision..."

@eamodio
Copy link
Member Author

eamodio commented Dec 13, 2023

@mogelbrod wow sorry about that, I dunno what happened with this one, but this should be fixed for real in tomorrow's pre-release (v2023.12.13xx)

@mogelbrod
Copy link
Contributor

Updated to v2023.12.1304 and unfortunately getting the same error. Also noticed that the Open file at revision... command doesn't even show up in the command palette - I've been triggering it via a hotkey all this time (gitlens.diffWithRevision). So I'm guessing the issue might be that the command itself technically doesn't support uncommitted files right now?

@eamodio
Copy link
Member Author

eamodio commented Dec 13, 2023

Ah, if you haven't staged the rename that is "by-design" -- Git (and GitLens by proxy) doesn't do rename detection until the file is staged. Prior to staging, Git just sees things as a file that was deleted and a new file that was added. And that new file is untracked, and thus has no history.

There was an issue when you staged it as well (and it shows as a rename), but that is what should now be fixed.

@mogelbrod
Copy link
Contributor

mogelbrod commented Dec 13, 2023

For consistency and to avoid confusion, could it make sense to still prompt for another file if the command is called with a file that is neither staged nor committed? It's a common use case for me to want to compare a renamed file with the one in history, and it will be kinda annoying to have to remember to first stage it temporarily just to do so (especially if I already have a busy staging area)

@eamodio eamodio removed the pending-release Resolved but not yet released to the stable edition label Dec 18, 2023
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
@eamodio
Copy link
Member Author

eamodio commented Jan 18, 2024

Opened #3109 to track #3050 (comment)

@d13 d13 removed the bug label Feb 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-verification Request for verification
Projects
None yet
Development

No branches or pull requests

3 participants