Sertion / vscode-gitblame

Visual Studio Code Extension - See Git Blame info in status bar.
https://marketplace.visualstudio.com/items/waderyan.gitblame
MIT License
79 stars 32 forks source link

Make gitblame.remoteName be used if unable to determine remote #74

Closed allight closed 4 years ago

allight commented 4 years ago

${project.remote} will try to determine the appropriate remote based off the current branch. This changes it to use the gitblame.remoteName if it is unable to determine the current branch or remote.

Test: Manual.

Sertion commented 4 years ago

Hello Alex. Thank you for taking time to add/fix a feature in the extension!

I think I understand what you are changing but I am a bit unsure what problem you are solving. Could you please expand a bit on what the extension is unable to do today that this will allow it to do in the future?

allight commented 4 years ago

Try opening a file on a branch with a detached head (for example an AOSP checkout) using ${project.remote} in the Commit-url and try to get a link for a line on the file.

This will fail since the blame isn't able to find the remote.

For example I have:

  "gitblame.commitUrl": "https://${project.remote}/+/${hash}"
  "gitblame.remoteName": "aosp"

This change makes one use the default remote if it cannot find it from the branch. For example in AOSP you'd want to default to the 'aosp' remote usually.

Sertion commented 4 years ago

Thank you for the explanation. I added it to my under construction branch.