-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 any file from another branch #708
Comments
I would LOVE this feature. Any movement on this? |
I can see this being a useful feature, but we (the GitLens team) aren't going to look at it anytime soon, so if the community wanted to open a PR for it we'd definitely be open to accepting it. |
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile` Also renames the `rethrow` argument of `utils.openEditor()` to `throwOnError` to align it with `utils.findOrOpenEditor()`.
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile` Also renames the `rethrow` argument of `utils.openEditor()` to `throwOnError` to align it with `utils.findOrOpenEditor()`.
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile` Also renames the `rethrow` argument of `utils.openEditor()` to `throwOnError` to align it with `utils.findOrOpenEditor()`.
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile` Also renames the `rethrow` argument of `utils.openEditor()` to `throwOnError` to align it with `utils.findOrOpenEditor()`.
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile` Also renames the `rethrow` argument of `utils.openEditor()` to `throwOnError` to align it with `utils.findOrOpenEditor()`.
I've got a PR up that implements this in #2825 |
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile`
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile`
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile`
Improves the `openFileAtRevision()` function by: - Asking user to enter another path when the requested file doesn't exist in the selected revision. - Showing an error message on subsequent failure (or if an error is thrown). The above function is used by a number of commands: - `gitlens.openFileRevision` - `gitlens.openFileRevisionFrom` - `gitlens.openRevisionFile`
Thanks to @mogelbrod's PR this has landed! Thank you! Can you please verify this fix in tomorrow's ( 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. |
@eamodio that's great! I tried the pre-release (v2023.12.704 ) just now and encountered a potential issue:
Expected behaviour: be presented with a revision picker Nothing logged to the GitLens output |
@mogelbrod that seems to be an existing bug, which I moved to #3050 (which will be fixed in tomorrow's pre-release) |
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. |
Recently #646 was implemented, but it doesn't completely work for me. The reason being that sometimes a file is renamed, and then the command (understandably) fails. In emacs/magit this is handled like that: you run the command, then by default the same filename as your current file is displayed and you just press enter if you want the same filename, but you can edit the filename if needed.
Maybe that gitlens feature,
gitlens.openFileRevisionFromBranch
, could be improved so that if it doesn't find the file in another branch, it doesn't fail but rather gives the user the opportunity to manually specify a filename.In my case I renamed a
.ts
file to.tsx
, but there could be many examples of renaming files.The text was updated successfully, but these errors were encountered: