Skip to content
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 File on Remote" does not open Command Palette to select branch to open file on #1071

Closed
Sayvai opened this issue Jul 13, 2020 · 11 comments
Assignees
Labels
feature New feature or request needs-verification Indicates a request for community verification
Milestone

Comments

@Sayvai
Copy link

Sayvai commented Jul 13, 2020

  • GitLens Version: 10.2.2
  • VSCode Version: 1.47 (and several versions before)
  • OS Version: OS X Catalina 10.15.5

Description:

In the majority of cases whenever i want to open a file on remote (via tab context menu), a new browser tab is opened, navigating to the file hosted on the remote repository against the branch i am working on. However, in-between this process the VS Code Command Palette does not open at all, which should expose a list of selectable branches.

However, it should instead display the VS Code Command Palette, exposing the list of selectable branch names, which then when selected, opens a new browser tab and then navigates to the remotely hosted file against the selected branch. Sometimes this actually works, but in most cases, the command palette does not open..

Am i missing something here? Is there a particular condition to which the command palette does open? If so what is that condition? Or is this a bug?

Steps to Reproduce:

  1. Right-click on any tab of an open file to open the context menu for the file
  2. Select the context menu option "Open File on Remote"

EXPECT --> The VS Code Command Palette to open, displaying selectable branch names to open the file against (see GIF below).

2020-07-13 12 10 54

ACTUAL --> The VS Code Command Palette does not open, and instead the file opens up in a browser against the current working branch.

2020-07-13 17 22 48

UPDATE 👉 : I figured out the scenario / pattern as to how to expose the VS Code Command Palette to be able to select the branch of choice to open the target file against. And that is, it will only open the Command Palette if your current working branch is not pushed up (i.e. current branch not available remotely). That makes sense.

However, i would prefer it if there was a configurable option for GitLens to always open the Command Palette to list the branches to which i want to open the file against when i click on Open File on Remote.

@Sayvai Sayvai added the potential-bug Seems like something isn't working label Jul 13, 2020
@nerdmax
Copy link

nerdmax commented Sep 15, 2020

Any plans for adding this config?

@TylerYep
Copy link

TylerYep commented Dec 5, 2020

I would also love this feature - I always want to open the file on master, not my working branch.

I use this, for example, when I am referencing a code file to someone.

@Sayvai
Copy link
Author

Sayvai commented Dec 5, 2020

I would also love this feature - I always want to open the file on master, not my working branch.

I use this, for example, when I am referencing a code file to someone.

@TylerYep That is also the most common use-case for me too.

To send a reference link to someone else, of the code file sitting on the master branch.

@eamodio eamodio added feature New feature or request and removed potential-bug Seems like something isn't working labels Dec 6, 2020
@eamodio eamodio self-assigned this Dec 6, 2020
@eamodio eamodio closed this as completed in a4b74d0 Dec 6, 2020
@eamodio eamodio added pending-release Indicates that the issue been resolved, but has not yet been released to the stable edition needs-verification Indicates a request for community verification labels Dec 6, 2020
@eamodio eamodio added this to the Soon™ milestone Dec 6, 2020
@eamodio
Copy link
Member

eamodio commented Dec 6, 2020

I added 2 new commands:

  • Open File on Remote From... command (gitlens.openFileOnRemoteFrom) to open a file or revision on a specific branch or tag on the remote provider
  • Copy Remote File Url From... command (gitlens.copyRemoteFileUrlFrom) to copy the url of a file or revision on a specific branch or tag the remote provider

Can you please verify this fix in tomorrow's insiders edition? Be sure to disable/uninstall the stable version of GitLens first.

You can install the insiders edition from here.

@eamodio eamodio reopened this Dec 6, 2020
@eamodio eamodio closed this as completed Dec 6, 2020
@Sayvai
Copy link
Author

Sayvai commented Dec 6, 2020

@eamodio thanks for looking into this!

I've tried the today's Insiders edition, and noticed you've included a new very convenient context menu option; Open File on Remote From..., and i found this very handy, as it will list all available branches to select from (see GIF below for reference) 👍

gitlens_open-file-on-remote-from

@Sayvai
Copy link
Author

Sayvai commented Dec 6, 2020

@eamodio Also, as you've instructed, i'll test the two new configuration settings tomorrow, re-downloading and installing the Insiders Edition again, as today's Insiders Edition does not recognise the new configuration settings.

I suspect that i'll set the new configuration settings values like so (using branch name: master for example), within the User Settings JSON file:

{
  "gitlens.openFileOnRemoteFrom": "master",
  "gitlens.copyRemoteFileUrlFrom": "master",
}

@eamodio
Copy link
Member

eamodio commented Dec 6, 2020

@Sayvai thanks for verifying. Although there are only those new commands, which show up in the menus and command palette, not any new configuration settings.

Are the new commands enough?

@Sayvai
Copy link
Author

Sayvai commented Dec 6, 2020

@eamodio Oh i see. I misread your initial comment, and realise they're just new commands!

Yes, I believe these new commands are certainly enough, as i really like the alternative command Copy Remote File URL From... , it really speeds my process up when sending file reference links to the desired branch without having a new browser tab automatically open the file, amongst all the other tabs i have open 👍

Just for reference to others, I also attach a GIF demo of this command. Also to note, the command is only accessible via the Command Palette Cmd + Shift + P (not via the context menu)

gitlens_copy-file-on-remote-from

Works perfectly 👌

@Sayvai
Copy link
Author

Sayvai commented Dec 6, 2020

@eamodio which stable version of the GitLens extension do you expect this to go in?

And are you able to give an estimate of when? 😬

@eamodio
Copy link
Member

eamodio commented Dec 11, 2020

Either this weekend or early next week.

@eamodio eamodio removed the pending-release Indicates that the issue been resolved, but has not yet been released to the stable edition label Dec 24, 2020
@eamodio eamodio modified the milestones: Soon™, Shipped Dec 24, 2020
@github-actions
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 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New feature or request needs-verification Indicates a request for community verification
Projects
None yet
Development

No branches or pull requests

4 participants