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.96k stars 1.29k forks source link

git remote get-url is http but open branch on remote url is always https #1918

Closed lisonge closed 1 year ago

lisonge commented 2 years ago

Steps to Reproduce:

  1. git clone httt://anyurl, is http not https
  2. open this folder in vscode
  3. click Source Control image 4.click BRANCHES then click Open Branch on Remote image
  4. browser will auto open this url, but this url is https instead of http

log gif 2022-03-21_10-22-26

how to fix it ?

lisonge commented 2 years ago

i find error come from https://github.com/gitkraken/vscode-gitlens/blob/555bd74a0651e60b70c05d6146e552ebbbfe19f5/src/git/remotes/provider.ts#L120 protocol should not be constant

lisonge commented 2 years ago

Does anyone replying to me?

eamodio commented 2 years ago

It is something I'll need to look into, and I haven't had a chance yet. Also the code you pointed out is not a constant, just a fallback if it is not provided to that constructor (which of course could be the case in some instances).

felipecrs commented 2 years ago

@lisonge could you please paste your Gitlens settings?

lisonge commented 2 years ago

@felipecrs

settings.json ```json5 { "[dart]": { "editor.formatOnSave": true, "editor.formatOnType": true, "editor.rulers": [80], "editor.selectionHighlight": false, "editor.suggest.snippetsPreventQuickSuggestions": false, "editor.suggestSelection": "first", "editor.tabCompletion": "onlySnippets", "editor.wordBasedSuggestions": false }, "[html]": { "editor.defaultFormatter": "vscode.html-language-features" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[json]": { "editor.defaultFormatter": "vscode.json-language-features" }, "[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, // "[latex]": { // "editor.defaultFormatter": "James-Yu.latex-workshop" // }, "[markdown]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[vue]": { "editor.autoClosingQuotes": "languageDefined", "editor.defaultFormatter": "esbenp.prettier-vscode", "editor.matchBrackets": "always" }, "backgroundCover.autoStatus": false, "backgroundCover.imagePath": "E:\\Pictures\\Camera Roll\\wallpaper\\69524620_p0.jpg", "backgroundCover.opacity": 0.2, "backgroundCover.randomImageFolder": "E:/Pictures/Camera Roll/wallpaper", "code-runner.clearPreviousOutput": true, "code-runner.saveFileBeforeRun": true, "dart.debugExternalLibraries": false, "dart.debugSdkLibraries": false, "dart.openDevTools": "flutter", "dart.previewLsp": true, "diffEditor.ignoreTrimWhitespace": false, // "editor.suggest.snippetsPreventQuickSuggestions": false // "emmet.showExpandedAbbreviation": "never" // "editor.tabSize": 2, "editor.accessibilitySupport": "off", "editor.fontFamily": "'MesloLGS NF', Consolas, 'Courier New', monospace", "editor.snippetSuggestions": "none", "editor.suggest.localityBonus": true, "editor.suggest.showWords": false, "editor.suggestSelection": "first", "explorer.confirmDelete": false, "explorer.confirmDragAndDrop": false, "fileheader.configObj": { "prohibitAutoAdd": ["gyp"] }, "fileheader.customMade": { "Author": "lisonge", "Date": "Do not edit", "LastEditTime": "Do not edit", "LastEditors": "lisonge" }, "files.autoGuessEncoding": true, "files.simpleDialog.enable": true, "git.autofetch": true, "git.enableSmartCommit": true, "git.ignoreMissingGitWarning": true, "gitlens.defaultDateFormat": null, "latex-workshop.latex.autoClean.run": "onBuilt", "latex-workshop.view.pdf.viewer": "tab", "liveServer.settings.donotShowInfoMsg": true, "markdownlint.config": { "no-inline-html": false }, "prettier.singleQuote": true, "prettier.tabWidth": 4, // "python.languageServer": "Pylance", // "python.venvPath": "~/.cache/pypoetry/virtualenvs", "security.workspace.trust.untrustedFiles": "open", "sortJSON.contextMenu": { // "sortJSON": false, "sortJSONAlphaNum": false, "sortJSONAlphaNumReverse": false, "sortJSONKeyLength": false, "sortJSONKeyLengthReverse": false, "sortJSONReverse": false, "sortJSONType": false, "sortJSONTypeReverse": false, "sortJSONValues": false, "sortJSONValuesReverse": false }, "terminal.integrated.rendererType": "dom", "todo-tree.tree.showScanModeButton": false, "typescript.updateImportsOnFileMove.enabled": "always", "update.enableWindowsBackgroundUpdates": false, "update.mode": "none", "update.showReleaseNotes": false, "workbench.colorCustomizations": { "[Material Theme Ocean]": {}, "activityBarBadge.background": "#E57373", "breadcrumb.activeSelectionForeground": "#E57373", "editor.findMatchBorder": "#E57373", "editorSuggestWidget.highlightForeground": "#E57373", "editorWidget.border": "#E57373", "editorWidget.resizeBorder": "#E57373", "list.activeSelectionForeground": "#E57373", "list.highlightForeground": "#E57373", "list.inactiveSelectionForeground": "#E57373", "menu.selectionForeground": "#E57373", "menubar.selectionForeground": "#E57373", "notificationLink.foreground": "#E57373", "panelTitle.activeBorder": "#E57373", "pickerGroup.foreground": "#E57373", "progressBar.background": "#E57373", "scrollbarSlider.activeBackground": "#E5737350", "selection.background": "#E5737340", "settings.headerForeground": "#E57373", "settings.modifiedItemIndicator": "#E57373", "statusBar.debuggingBackground": "#1d2031", "tab.activeBorder": "#E57373", "textLink.foreground": "#E57373", "[Material Theme Ocean High Contrast]": {} }, "workbench.editorAssociations": { "*.ipynb": "jupyter.notebook.ipynb", "*.ttf": "font.detail.preview" }, "workbench.iconTheme": "material-icon-theme", "[javascriptreact]": { "editor.defaultFormatter": "vscode.typescript-language-features" }, "[typescriptreact]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "files.associations": { "*.cjson": "jsonc", "*.wxss": "css", "*.wxs": "javascript" }, "emmet.includeLanguages": { "wxml": "html" }, "minapp-vscode.disableAutoConfig": true, "workbench.colorTheme": "Material Theme Ocean High Contrast", "terminal.integrated.profiles.windows": { // "PowerShell": { // "source": "PowerShell", // "icon": "terminal-powershell" // }, // "Command Prompt": { // "path": [ // "${env:windir}\\Sysnative\\cmd.exe", // "${env:windir}\\System32\\cmd.exe" // ], // "args": [], // "icon": "terminal-cmd" // }, // "Git Bash": { // "source": "Git Bash" // }, "PowerShell7": { "path": "pwsh" } }, "terminal.integrated.defaultProfile.windows": "PowerShell7", "svg.preview.mode": "svg", "todo-tree.regex.regexCaseSensitive": false, "git.confirmSync": false, "workbench.editor.splitInGroupLayout": "vertical" // "gutterpreview.paths": { // "@/": ["src"], // "@/*": ["src/*"] // }, // "gutterpreview.sourceFolder": "./" } ```
felipecrs commented 2 years ago

I think you are missing the following:

{
  "gitlens.remotes": [
    {"domain": "gitlab.qiwi.domain", "type": "Gitlab", "protocol": "http"},
  ],
}
lisonge commented 2 years ago

@felipecrs if set gitlens.remotes, gitlens will work, but i think gitlens should auto set protocol according to git remote -v

felipecrs commented 2 years ago

Yes, that's true, and it does not happen currently.

github-actions[bot] commented 1 year ago

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.