gitkraken / vscode-gitlens

Supercharge Git inside VS Code and unlock untapped knowledge within each repository — Visualize code authorship at a glance via Git blame annotations and CodeLens, seamlessly navigate and explore Git repositories, gain valuable insights via rich visualizations and powerful comparison commands, and so much more
http://gitkraken.com/gitlens
Other
8.87k stars 1.23k forks source link

Interactive rebase editor UI is broken #1172

Open miluoshi opened 3 years ago

miluoshi commented 3 years ago

No errors in devTools console. No errors in GitLens or GitLens (Git) extension output with debug mode on.

Steps to Reproduce:

  1. Run git rebase -i <commit_like>
  2. New tab with title git-rebase-todo with a broken UI opens (see screenshot)

image

Logs from GitLens output: ``` [2020-11-18 09:34:02:600] [1] GitService.initialize [2020-11-18 09:34:02:600] [2] GitService.getBuiltInGitApi [2020-11-18 09:34:02:866] [2] GitService.getBuiltInGitApi completed • 265 ms [2020-11-18 09:34:03:055] Git found: 2.25.1 @ /usr/bin/git • 188 ms [2020-11-18 09:34:03:055] [1] GitService.initialize completed • 455 ms [2020-11-18 09:34:03:063] Starting repository search in 1 folders [2020-11-18 09:34:03:064] [3] GitService.repositorySearch(/home/milos/code/myrepo) searching (depth=1)... [2020-11-18 09:34:03:064] [4] GitService.getRepoPathCore — e=/home/milos/code/myrepo, t=true [2020-11-18 09:34:03:070] [5] LineAnnotationController.resume [2020-11-18 09:34:03:070] [6] GitLineTracker.start [2020-11-18 09:34:03:070] [6] GitLineTracker.start completed • 0 ms [2020-11-18 09:34:03:070] [5] LineAnnotationController.resume completed • 0 ms [2020-11-18 09:34:03:070] [7] LineAnnotationController.refresh [2020-11-18 09:34:03:071] [8] GitLineTracker.start [2020-11-18 09:34:03:071] [8] GitLineTracker.start completed • 0 ms [2020-11-18 09:34:03:071] [9] GitLineTracker.start [2020-11-18 09:34:03:071] [9] GitLineTracker.start completed • 0 ms [2020-11-18 09:34:03:081] GitLens (v11.0.1) activated • 483 ms [2020-11-18 09:34:03:082] [7] LineAnnotationController.refresh completed • 11 ms [2020-11-18 09:34:03:098] [/home/milos/code/myrepo] git rev-parse --show-toplevel • 33 ms [2020-11-18 09:34:03:234] [a] RebaseEditorProvider.resolveCustomTextEditor — e=TextDocument(/home/milos/code/myrepo/.git/rebase-merge/git-rebase-todo), version=1, content=pick fbe29451ed ci: add Sentry setup and upload to the CI step for production pick 9a597d7013 pick 02a2d5b457 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # b, break = stop here (continue rebase later with 'git rebase --continue') # d, drop = remove commit # l, label
Logs from GitLens (Git) output: ``` [2020-11-18 09:34:03:098] [/home/milos/code/myrepo] git rev-parse --show-toplevel • 33 ms [2020-11-18 09:34:03:417] [/home/milos/code/myrepo] git remote -v • 8 ms [2020-11-18 09:34:03:570] [/home/milos/code/myrepo] git ls-files -- /home/milos/code/myrepo • 7 ms [2020-11-18 09:34:03:596] [/home/milos/code/myrepo] git for-each-ref --format=%3ch%3e%(HEAD)%3cn%3e%(refname)%3cu%3e%(upstream:short)%3ct%3e%(upstream:track)%3cr%3e%(objectname)%3cd%3e%(committerdate:iso8601) refs/heads refs/remotes • 26 ms [2020-11-18 09:34:03:607] [/home/milos/code/myrepo] git log --format=%x3c%x2ff%x3e%n%x3cr%x3e%x20%H%n%x3ca%x3e%x20%aN%n%x3ce%x3e%x20%aE%n%x3cd%x3e%x20%at%n%x3cc%x3e%x20%ct%n%x3cp%x3e%x20%P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e --full-history -M -m --name-status -n3 -- • 5 ms [2020-11-18 09:34:03:612] [/home/milos/code/myrepo] git config --get-regex user.(name|email) • 4 ms [2020-11-18 09:34:03:617] [/home/milos/code/myrepo] git check-mailmap Milos Lajtman • 4 ms [2020-11-18 09:34:03:626] [/home/milos/code/myrepo] git log --format=%x3c%x2ff%x3e%n%x3cr%x3e%x20%H%n%x3ca%x3e%x20%aN%n%x3ce%x3e%x20%aE%n%x3cd%x3e%x20%at%n%x3cc%x3e%x20%ct%n%x3cp%x3e%x20%P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e --full-history -M -m --name-status -n3 02a2d5b457 -- • 5 ms [2020-11-18 09:34:03:633] [/home/milos/code/myrepo] git log --format=%x3c%x2ff%x3e%n%x3cr%x3e%x20%H%n%x3ca%x3e%x20%aN%n%x3ce%x3e%x20%aE%n%x3cd%x3e%x20%at%n%x3cc%x3e%x20%ct%n%x3cp%x3e%x20%P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e --full-history -M -m --name-status -n3 9a597d7013 -- • 5 ms [2020-11-18 09:34:03:639] [/home/milos/code/myrepo] git log --format=%x3c%x2ff%x3e%n%x3cr%x3e%x20%H%n%x3ca%x3e%x20%aN%n%x3ce%x3e%x20%aE%n%x3cd%x3e%x20%at%n%x3cc%x3e%x20%ct%n%x3cp%x3e%x20%P%n%x3cs%x3e%n%B%n%x3c%x2fs%x3e%n%x3cf%x3e --full-history -M -m --name-status -n3 fbe29451ed -- • 5 ms ```
miluoshi commented 3 years ago

Additional info - the first time I tried to rebase after update of the extension I got it working (but without icons). After restart of vscode on the next rebase I got this.

NgxDev commented 3 years ago

No rebase editor/tab shown at all, in my case. I go to the "Source Control" pane (since now GitLens is "merged" into that, I like it and didn't switch back), then to the "Branches" section, right-click a branch I started the current one from (after doing some commits on that original branch) and chose "Rebase Current Branch onto Branch..." image Then I get the dropdown menu (where the command palette shows up) with 3 options: "Rebase", "Interactive Rebase" and "Cancel". If I choose "Interactive Rebase", the VSCode terminal opens and I just get this output:

git rebase --interactive rebase-test
pick 45fcb42 rb2-commit-1

# Rebase 2c7afdc..45fcb42 onto 2c7afdc (1 command)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
~                                                                                                                                                                                          
~                                                                                                                                                                                                                                                                                                                                                                
~                                                                                                                                                                                          
-- INSERT --

and the only thing I can do is either edit it or just :q and then it goes ahead and rebases... I get no visual editor, like shown in this preview: interactive-rebase-editor

plwalsh commented 3 years ago

I encountered the behavior in the OP when trying to rebase using both the --interactive and --preserve-merges options, which I didn't realize was an "incompatible option pair" according to the git docs.

guu980-dev commented 3 years ago

No rebase editor/tab shown at all, in my case. I go to the "Source Control" pane (since now GitLens is "merged" into that, I like it and didn't switch back), then to the "Branches" section, right-click a branch I started the current one from (after doing some commits on that original branch) and chose "Rebase Current Branch onto Branch..." image Then I get the dropdown menu (where the command palette shows up) with 3 options: "Rebase", "Interactive Rebase" and "Cancel". If I choose "Interactive Rebase", the VSCode terminal opens and I just get this output:

git rebase --interactive rebase-test
pick 45fcb42 rb2-commit-1

# Rebase 2c7afdc..45fcb42 onto 2c7afdc (1 command)
#
# Commands:
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# b, break = stop here (continue rebase later with 'git rebase --continue')
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label
# m, merge [-C <commit> | -c <commit>] <label> [# <oneline>]
# .       create a merge commit using the original merge commit's
# .       message (or the oneline, if no original merge commit was
# .       specified). Use -c <commit> to reword the commit message.
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
~                                                                                                                                                                                          
~                                                                                                                                                                                                                                                                                                                                                                
~                                                                                                                                                                                          
-- INSERT --

and the only thing I can do is either edit it or just :q and then it goes ahead and rebases... I get no visual editor, like shown in this preview: interactive-rebase-editor

I encountered with same problem,,,,

eamodio commented 3 years ago

@miluoshi can you try with v11.0.2 -- hopefully that will fix the CSP issues

eamodio commented 3 years ago

@MrCroft @guu980-dev your issue is https://github.com/eamodio/vscode-gitlens/issues/1163

miluoshi commented 3 years ago

@miluoshi can you try with v11.0.2 -- hopefully that will fix the CSP issues

Interesting. At first, it displayed broken UI with new Disable button image

Clicking on Disable did nothing. Then I changed tab (opened settings) and went back to interactive rebase tab and it displayed correctly then. image

It looks like it was stuck in some unitialized state and changing tab made it reload or something.

gabrielnemeth commented 3 years ago

image

Same thing for me. I'm on 11.0.2. Even changing the tabs like for @miluoshi doesn't work for me.

eamodio commented 3 years ago

@gabrielnemeth what os are you on? Are you connecting to any remote? ssh, wsl, etc? Can you also open up the devtools (open webview developer tools) to see if you see the same csp error?

gabrielnemeth commented 3 years ago

I'm on Windows 10 v. 2004. I'm using WSL2. When I open the dev tools I can see an error: image

eamodio commented 3 years ago

Hrm, that error always happens (not related to GitLens). Can you switch to the network tab of the devtools and hit F5 to refresh the webview? And see if any requests fail?

Also do you see any errors on the Output pane for GitLens?

gabrielnemeth commented 3 years ago

Everything looks fine to me. No error whatsoever neither in network nor in the output pane.

eamodio commented 3 years ago

Does it happen on any rebase or specific to a set of commit or project?

gabrielnemeth commented 3 years ago

It does happen in all projects under wsl2. If I'm under "pure" windows I can't open the rebase editor, since every time I type the rebase command in powershell, it opens the vim version in the terminal.

eamodio commented 3 years ago

@gabrielnemeth I'm really at a loss. I can't reproduce any issue with the rebase editor not loading over WSL (or any other case). Can you try uninstalling GitLens from WSL and re-installing it?

Though the other issue you mention will be resolved with: #1163

gabrielnemeth commented 3 years ago

I think I got it. I think it's a resolution related issue. The issue is present on 4k, but if I change my laptop's resolution to full HD it works just fine.

miluoshi commented 3 years ago

It happened to me again today. I don't have 4k monitor, if that helps.

The worst thing is I even can't disable interactive rebase editor with proposed solution - when I rebase through UI it opens broken editor. Only option for me is to run rebase from terminal.

hi0t commented 3 years ago

I'm using WSL and have the same problem. On the same version, everything was fine yesterday, today the rebase is broken. Same with settings: image

eamodio commented 3 years ago

Is anyone who is able to reproduce this able to debug into it? I can't reproduce this at all, locally, over WSL or any other remote. I'm really at a loss. It feels like this may be a VS Code bug, but not sure.

/cc @mjbvz have you seen anything like this?

hi0t commented 3 years ago

I think I know. If the extension is installed locally and remotely then everything is fine. If the extension is installed only remotely, the settings and rebase interfaces are broken. At least that's the case for me.

eamodio commented 3 years ago

Great information! I will try that scenario out. Thank you!

eamodio commented 3 years ago

@hi0t How do you actually get it to not be installed locally? Are you manually uninstalling it locally after installing it in the remote?

eamodio commented 3 years ago

I still can't reproduce this 😢

eamodio commented 3 years ago

I'm thinking this must be a vscode bug -- does this issue align with any of you experiencing this: https://github.com/microsoft/vscode/issues/103884?

Are you using WSL1 or 2 (I've been testing with 2), do you have a VPN or other special networking? We really need to find some way to reproduce this.

mjbvz commented 3 years ago

If you are hitting this issue, besides the steps @eamodio mentioned, please also try setting "webview.experimental.useIframes": true in your vscode settings.json file and then reloading VS Code.

This changes the implementation of VS Code's webviews (which power the rebase editor). If the webview works with iframes enabled, we at least know where to start looking in the code

eamodio commented 3 years ago

Sweet without "webview.experimental.useIframes": true in my settings I can reproduce it!

hi0t commented 3 years ago

Here is my extensions config: image And I am using outbound vpn connection. In theory, VPN can influence. Because among the secured routes there are subnets: 172.17.0.0/16 172.19.0.0/16 172.20.0.0/16

eamodio commented 3 years ago

This is an issue in VS Code (https://github.com/microsoft/vscode/issues/103884). Until that is fixed, it seem that setting "webview.experimental.useIframes": true in your settings.json avoids the issue, or possibly ensuring that GitLens is installed both locally and in the WSL remote.

miluoshi commented 3 years ago

For me it was working again for some time and the issue came back a couple of days ago again.

I'm using WSL2, the extension is intalled both locally and in WSL2, and I'm NOT using any VPN. The "webview.experimental.useIframes": true setting doesn't change anything for me and VSCode doesn't recognize this setting (Getting "Unknown Configuration Setting" warning). Isn't it Insiders-only setting? I'm using VSCode v1.52.1

eamodio commented 3 years ago

Who is still experiencing this issue? Unfortunately, neither Matt nor I can reproduce this on 1.52.1 or 1.53-insiders (I was able to for a short time, but now I can't no matter what I try). So any more details on your setup would be helpful.

eamodio commented 3 years ago

It looks like the https://github.com/microsoft/vscode/issues/105536 has been fixed in 1.54-insiders (1.54 stable should ship later this week). Can anyone one experiencing the issue still reproduce it on 1.54-insiders?

hi0t commented 3 years ago

Works for me at 1.54. I will watch.

bersbersbers commented 3 years ago

I have been seeing this issue since using Remote SSH on 1.57.x, now on 1.58.1. I do not see it in current insiders (9520f0a515e7e24802c92f885a0efb242fca3831), with the same SSH server, same configuration, same extensions (thanks to settings sync).

Interestingly, the same is true for another issue, which is Markdown math rendering - see here: https://github.com/microsoft/vscode/issues/128309 I wonder if these two issues are related - both seem to have something to do with webviews and extra resources.

I also wonder if my installation is simply broken somehow - I may try reinstalling vscode in a few days until someone is interested in me digging deeper into this.

FYI: reinstalling the server component and only GitLens extensions on the remote server did not fix the issue, neither did removing all my settings.

bersbersbers commented 3 years ago

I have tried uninstalling and reinstalling local and remote VS Code, removed "%USERPROFILE.vscode" and "%APPDATA\Code". It's not only the rebase view - this is what "Welcome" looks like:

image

WebView dev tools show only this - I wonder if this is related:

[Deprecation] Subresource requests whose URLs contain embedded credentials (e.g. https://user:pass@host/) are blocked. See https://www.chromestatus.com/feature/5669008342777856 for more details. (anonymous) @ main.js:701

(And, yes, again - I seem the same warning in the context of https://github.com/microsoft/vscode/issues/128309, and not in Insiders.)

bersbersbers commented 3 years ago

After some investigation, the problem I describe is 100% independent of GitLens, see https://github.com/microsoft/vscode-remote-release/issues/5282#issuecomment-886506235