Sertion / vscode-gitblame

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

Multiple remotes, Related to #167 #169

Closed Daviid-P closed 3 months ago

Daviid-P commented 3 months ago

This is related to #167

I ended up installing Gitea and now have 2 remote push urls.

git remote -v
origin  http://daviid@192.168.1.89/Bonobo.Git.Server/MyRepository.git (fetch)
origin  http://daviid@192.168.1.89/Bonobo.Git.Server/MyRepository.git (push)
origin  http://192.168.1.25:32785/daviid/MyRepository.git (push)

Now the extension seems to work fine (I assume because Gitea is just like GitHub) but I'm not sure if the case of having multiple remotes is contemplated or if it's just a happy accident.

Doing git config remote.origin.url only returns one url

http://192.168.1.25:32785/daviid/MyRepository.git

Sertion commented 3 months ago

Hey David. Thanks for the concern.

As of now we use git ls-remote --get-url [remote-name] where [remote-name] is the gitblame.remoteName property value ("origin" by default).

Currently (and for a very long time before that) it has only been able to return a single line. I've not dug deeper into how the URL is selected when there are multiple matches, but since it has been stable for at least 14 years I feel we can assume it will be stable for the foreseeable future.